Data processing method and device

By identifying the server interface type and data transmission protocol, querying configuration files, and realizing multi-protocol integration, the inefficiency problem caused by protocol diversity in smart terminals in multi-device communication is solved, and data transmission efficiency and development efficiency are improved.

CN119232818AInactive Publication Date: 2024-12-31SHANGHAI ROBESTEC ENERGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411745800.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

As the number of devices increases, when smart terminals need to communicate with multiple devices, the diversity of communication protocols leads to inefficient query and call, and multiple communication protocols need to be developed, increasing the storage and development burden.

Method used

By identifying the interface type and data transmission protocol of the server, querying configuration files, obtaining data storage locations, packaging and transmitting data, multi-protocol integration is achieved, reducing development resource consumption, and improving communication efficiency.

Benefits of technology

Without additional code development, the client can support multiple data transmission protocols, directly identify server interface types, improve data transmission efficiency, reduce development resource consumption, and improve protocol query and call efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232818A_ABST
    Figure CN119232818A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device.The data processing method comprises the steps that in response to a data transmission request for a server side, a target interface is called to recognize the interface type of the server side and a target data transmission protocol; when it is determined that the interface type is matched with the target interface according to the identification result, querying a configuration file corresponding to the target data transmission protocol in a database; obtaining a mapping relationship between the target data transmission protocol stored in the configuration file and a storage position of to-be-transmitted data in the database, and reading the to-be-transmitted data in the database according to the storage position; and packaging and transmitting the to-be-transmitted data to the server according to a target data transmission format corresponding to the target data transmission protocol.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of computer technology, and in particular, to a data processing method. Background Art

[0002] With the development of technology, there are now a large number of intelligent terminals (such as computers and other intelligent devices) that can be used for data transmission and data analysis, and these intelligent terminals need to be connected to other devices directly or indirectly for data transmission between devices.

[0003] However, since different smart terminals or different devices may use different communication protocols, when a smart terminal communicates with another device, it needs to load the communication protocol corresponding to the device to realize the communication process between the two based on the communication protocol. However, as the number of devices increases, the number of communication protocols will also show explosive growth. If a smart terminal needs to communicate with multiple devices, and the communication protocols of multiple devices are different, the smart terminal needs to develop multiple communication protocols separately, which may cause the smart device to store too many communication protocols, resulting in low efficiency in querying, obtaining and calling communication protocols. Summary of the invention

[0004] In view of this, an embodiment of this specification provides a data processing method. One or more embodiments of this specification also relate to a data processing device, a computing device, a computer-readable storage medium and a computer program to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of this specification, a data processing method is provided, including: In response to a data transmission request for a server, calling a target interface to identify an interface type and a target data transmission protocol of the server; When it is determined according to the identification result that the interface type matches the target interface, querying a configuration file corresponding to the target data transmission protocol in a database; Acquire a mapping relationship between the target data transmission protocol stored in the configuration file and a storage location of the data to be transmitted in the database, and read the data to be transmitted in the database according to the storage location; The data to be transmitted is packaged and transmitted to the server according to the target data transmission format corresponding to the target data transmission protocol.

[0006] Optionally, the step of packaging and transmitting the data to be transmitted to the server according to a target data transmission format corresponding to the target data transmission protocol includes: According to the target data transmission format corresponding to the target data transmission protocol, the data to be transmitted is packaged to generate a corresponding executable file; By performing a joint debugging test on the executable file with the server, a corresponding test result is generated; When it is determined according to the test result that the test passes, the executable file is transmitted to the server.

[0007] Optionally, the data processing method further includes: In the case where it is determined according to the identification result that the interface type does not match the target interface, configuring the protocol parameters of the target data transmission protocol and the target data transmission format to generate a corresponding configuration file; Determine the data to be transmitted according to the target data transmission format, and determine the storage location of the data to be transmitted in the database; A mapping relationship between the storage location and the target data transmission protocol is established, the mapping relationship is stored in the configuration file, and the configuration file is stored in the database.

[0008] Optionally, the data processing method further includes: Obtain at least two data transmission protocols, and obtain protocol parameters and a data transmission format of each data transmission protocol; A protocol integration program of the at least two data transmission protocols is compiled according to the protocol identifier of each data transmission protocol, the protocol parameters and the data transmission format.

[0009] Optionally, the data processing method further includes: In the case where it is determined according to the identification result that the interface type does not match the target interface, determining target protocol parameters of the target data transmission protocol; Compiling a protocol subroutine of the target data transmission protocol according to the protocol identifier of the target data transmission protocol, the target protocol parameters and the target data transmission format; Add the protocol subprogram to the protocol integration program.

[0010] Optionally, the querying a database for a configuration file corresponding to the target data transmission protocol includes: By executing the protocol integration program, a configuration file corresponding to the target data transmission protocol is queried in a database.

[0011] Optionally, after querying the configuration file corresponding to the target data transmission protocol in the database, the method further includes: Comparing a target data transmission format corresponding to the target data transmission protocol with a data transmission format included in the configuration file; In case of inconsistency in the comparison, the configuration file is updated based on the target data transmission format.

[0012] According to a second aspect of an embodiment of this specification, there is provided a data processing device, including: an identification module, configured to, in response to a data transmission request for a server, call a target interface to identify an interface type and a target data transmission protocol of the server; A query module configured to query a configuration file corresponding to the target data transmission protocol in a database when it is determined according to the identification result that the interface type matches the target interface; an acquisition module, configured to acquire a mapping relationship between the target data transmission protocol stored in the configuration file and a storage location of the data to be transmitted in the database, and read the data to be transmitted in the database according to the storage location; The transmission module is configured to package the data to be transmitted and transmit it to the server according to the target data transmission format corresponding to the target data transmission protocol.

[0013] According to a third aspect of an embodiment of this specification, a computing device is provided, including: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement any step of the data processing method.

[0014] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of any one of the data processing methods are implemented.

[0015] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned data processing method.

[0016] The data processing method provided in the embodiment of this specification, by responding to the data transmission request for the server, calling the target interface to identify the interface type and the target data transmission protocol of the server; when it is determined that the interface type matches the target interface according to the identification result, querying the configuration file corresponding to the target data transmission protocol in the database; obtaining the mapping relationship between the target data transmission protocol stored in the configuration file and the storage location of the data to be transmitted in the database according to the storage location, and reading the data to be transmitted in the database according to the storage location; and packaging the data to be transmitted to the server according to the target data transmission format corresponding to the target data transmission protocol. In the embodiment of this specification, the client integrates multiple data transmission protocols into a protocol integration program, and then configures the relevant data of each data transmission protocol to generate a corresponding configuration file and stores it, so that the target interface of the client can support multiple data transmission protocols. Later, when the client needs to report data to the server, it can directly identify the interface type of the server, and when it is determined that the interface type matches the target interface, it means that the client can communicate with the server using the same data transmission protocol as the server. In this case, subsequent configuration files can be queried directly, and the data to be transmitted can be read, packaged, and transmitted without additional code development. This is not only conducive to reducing the resource consumption of program development, but also conducive to improving the query, acquisition and calling efficiency of the communication protocol, thereby improving data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a flow chart of a data processing method provided by an embodiment of this specification; Figure 2 It is an architectural diagram of a data processing process provided by an embodiment of this specification; Figure 3 is a processing flow chart of a data processing method provided by an embodiment of this specification; Figure 4 is a structural schematic diagram of a data processing device provided by an embodiment of this specification; Figure 5 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0018] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0019] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0020] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0021] First, the terms involved in one or more embodiments of this specification are explained.

[0022] Message Queuing Telemetry Transport (MQTT): is a "lightweight" communication protocol based on the publish / subscribe model.

[0023] Socket: It is an abstraction of the endpoint for two-way communication between application processes on different hosts in the network. It is the interface for applications to communicate through network protocols and the interface for applications to interact with the network protocol stack.

[0024] Extensible Markup Language (XML): A subset of the standard generalized markup language that can be used to mark data and define data types. It is a source language that allows users to define their own markup languages.

[0025] Simple Object Access Protocol (SOAP): It is a protocol specification for exchanging data. It is a lightweight, simple, XML-based protocol.

[0026] Web Service: is a remote calling technology that spans programming languages ​​and operating system platforms. Web Service uses the standard SOAP protocol to transmit business data on the Web.

[0027] In this specification, a data processing method is provided. This specification also relates to a data processing apparatus, a computing device, a computer-readable storage medium, and a computer program, which are described in detail one by one in the following embodiments.

[0028] Figure 1 A flow chart of a data processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0029] Step 102: In response to a data transmission request for a server, a target interface is called to identify the interface type of the server and a target data transmission protocol.

[0030] The data processing method provided in the embodiments of this specification is applied to a client, and the client may be a client of an energy storage power station, and is used to report relevant data of the energy storage power station to a server.

[0031] Specifically, since the target data transmission protocol, i.e., the communication protocol, used by the server may be different from the communication protocol used by the client, or, when the client needs to report data to at least two servers, the data transmission protocols used by the at least two servers may also be different. Therefore, before reporting data to the server, the client may first determine whether the target data transmission protocol used by the server is consistent with any one of the at least two data transmission protocols supported by the client.

[0032] Among them, the data transmission request for the server is generated by the client, and the request can be used to indicate that the client has a need to report data to the server. The target interface is the interface used by the client to communicate with the server; similarly, the server is also provided with an interface for communicating with the client. Therefore, in the embodiment of this specification, the client can identify the interface type of the server interface by calling the target interface, and specifically can parse the interface signal to determine the interface type used by the server, and then determine whether the interface type used by the server is consistent with any one of the at least two interface types supported by the client, that is, determine whether the data transmission protocols used by the two are consistent.

[0033] In an optional implementation, the data processing method further includes: Obtain at least two data transmission protocols, and obtain protocol parameters and a data transmission format of each data transmission protocol; A protocol integration program of the at least two data transmission protocols is compiled according to the protocol identifier of each data transmission protocol, the protocol parameters and the data transmission format.

[0034] Specifically, before reporting data to one or at least two servers, the client may first determine the data transmission protocol used by each server, or may first determine at least two data transmission protocols that the client can support, and then develop a protocol integration program based on these data transmission protocols.

[0035] The architecture diagram of a data processing process provided in the embodiment of this specification is as follows Figure 2 As shown, by executing this set of protocol integration programs, it is possible to communicate with other devices using the same communication protocol according to any one of the protocols in this part of the data transmission protocols.

[0036] In addition, since the protocol parameters of different data transmission protocols and their corresponding data transmission formats may be different, the protocol parameters and data transmission format of each data transmission protocol can be obtained first, and then a protocol integration program for at least two data transmission protocols can be compiled based on the protocol identifier, protocol parameters of each data transmission protocol and the data transmission format corresponding to each data transmission protocol.

[0037] The protocol parameters include, but are not limited to, communication interface standards, communication formats, and IP addresses.

[0038] In addition, it is also possible to determine the data to be transmitted corresponding to each data transmission protocol based on the data transmission format corresponding to each data transmission protocol, and then determine the storage location of the data to be transmitted in the database, and establish a mapping relationship between the storage location and the protocol identifier of the data transmission protocol, and then write the mapping relationship into the protocol integration program; or, it is also possible to establish a configuration file for each data transmission protocol, and then write the mapping relationship between the storage location and the protocol identifier of the data transmission protocol into the configuration file, write the file identification information of the configuration file into the protocol integration program, and store the configuration file in the database.

[0039] The data transmission protocols in the embodiments of this specification include but are not limited to MQTT, protocols supported by Web Services, and protocols supported by sockets.

[0040] Step 104: When it is determined according to the identification result that the interface type matches the target interface, query a database for a configuration file corresponding to the target data transmission protocol.

[0041] Specifically, if the interface type of the server is consistent with the interface type of the target interface, and the target data transmission protocol used by the server is the same as one of the multiple data transmission protocols accommodated by the target interface, it can be determined that the interface type of the server matches the target interface.

[0042] When it is determined according to the identification result that the interface type of the server matches the target interface of the client, the configuration file corresponding to the data transmission protocol can be queried in the database to query the data to be transmitted according to the data stored in the configuration file.

[0043] In an optional implementation, the data processing method further includes: In the case where it is determined according to the identification result that the interface type does not match the target interface, configuring the protocol parameters of the target data transmission protocol and the target data transmission format to generate a corresponding configuration file; Determine the data to be transmitted according to the target data transmission format, and determine the storage location of the data to be transmitted in the database; A mapping relationship between the storage location and the target data transmission protocol is established, the mapping relationship is stored in the configuration file, and the configuration file is stored in the database.

[0044] Specifically, when it is determined based on the identification results that the interface type of the server does not match the target interface of the client, that is, it is determined that the interface type of the server is inconsistent with the interface type of the target interface, or the data transmission protocol used by the server is different from any one of at least two data transmission protocols supported by the client, an interface mismatch alarm message can be generated first, and the alarm message is used to prompt the client to add the configuration of the new protocol.

[0045] After receiving the alarm information, the client can configure the protocol parameters and data transmission format of the target data transmission protocol, generate a corresponding configuration file, and then determine the data to be transmitted according to the target data transmission format, and determine the storage location of the data to be transmitted in the database; then establish a mapping relationship between the storage location and the target data transmission protocol, store the mapping relationship in the configuration file, and store the configuration file in the database.

[0046] The configuration information in the configuration file includes, but is not limited to, source port, destination port, interface name, interface, and data content to be transmitted.

[0047] In another optional implementation, the data processing method further includes: In the case where it is determined according to the identification result that the interface type does not match the target interface, determining target protocol parameters of the target data transmission protocol; Compiling a protocol subroutine of the target data transmission protocol according to the protocol identifier of the target data transmission protocol, the target protocol parameters and the target data transmission format; Add the protocol subprogram to the protocol integration program.

[0048] Specifically, when it is determined based on the identification result that the interface type of the server does not match the target interface of the client, that is, it is determined that the interface type of the server is inconsistent with the interface type of the target interface, or the data transmission protocol used by the server is different from any one of the at least two data transmission protocols supported by the client, the client can compile a protocol subroutine of the target data transmission protocol based on the protocol identifier, target protocol parameters and target data transmission format corresponding to the target data transmission protocol, so that the client supports the use of the target data transmission protocol.

[0049] After the protocol subprogram is compiled, the protocol subprogram can be added to the aforementioned protocol integration program, so that the client can communicate with different devices through different data transmission protocols by running a set of protocol integration programs.

[0050] In addition, on the basis of determining the data to be transmitted according to the target data transmission format and determining the storage location of the data to be transmitted in the database, and then establishing a mapping relationship between the storage location and the target data transmission protocol, and storing the mapping relationship in the configuration file, the file information of the configuration file can also be written into the protocol subroutine, so that by running the protocol integration program, the configuration file can be automatically read, and the data to be transmitted can be searched in the database according to the mapping relationship in the configuration file.

[0051] In the embodiment of the present specification, the configuration file corresponding to the target data transmission protocol is queried in the database. Specifically, the configuration file corresponding to the target data transmission protocol can be queried in the database by executing the protocol integration program.

[0052] Specifically, when the relevant information of the configuration file is recorded in the protocol integration program, the configuration file corresponding to the target data transmission protocol can be automatically queried in the database by executing the protocol integration program.

[0053] Step 106: Obtain a mapping relationship between the target data transmission protocol stored in the configuration file and a storage location of the data to be transmitted in the database, and read the data to be transmitted in the database according to the storage location.

[0054] Specifically, after automatically querying the configuration file corresponding to the target data transmission protocol in the database by executing the protocol integration program, it is also possible to automatically read the mapping relationship between the target data transmission protocol stored in the configuration file and the storage location of the data to be transmitted in the database by executing the protocol integration program, and automatically read the data to be transmitted in the corresponding storage location of the database based on the mapping relationship.

[0055] In addition, when the mapping relationship between each data transmission protocol and the storage location of the data to be transmitted is recorded in the protocol integration program, the protocol integration program can be executed to realize the process of automatically reading the data to be transmitted in the database and automatically transmitting the read data to be transmitted to the server.

[0056] In an optional implementation, after querying the configuration file corresponding to the target data transmission protocol in the database, the method further includes: Comparing a target data transmission format corresponding to the target data transmission protocol with a data transmission format included in the configuration file; In case of inconsistency in the comparison, the configuration file is updated based on the target data transmission format.

[0057] Specifically, the data transmission format is the format of transmitted data, which may also be called a data format or a message format. The data transmission format may be used to specify the data content to be transmitted, and the data content may change with time or changes in business content.

[0058] For example, when the client reports data to the server for the first time, the server specifies that the client needs to transmit data A, data B, and data C to it, so the data transmission format stored in the client's configuration file includes data A, data B, and data C. However, at the current moment, the server specifies that the client needs to transmit data A, data B, and data D to it, which will cause the target data transmission format corresponding to the target data transmission protocol to be inconsistent with the data transmission format contained in the configuration file. In this case, the data transmission format in the configuration file needs to be updated based on the target data transmission format.

[0059] After the update is completed, the protocol integration program uses hot loading to read the relevant content in the configuration file without restarting the program, which is conducive to ensuring the efficiency of data transmission.

[0060] Step 108: Packaging the data to be transmitted and transmitting it to the server according to the target data transmission format corresponding to the target data transmission protocol.

[0061] In an optional implementation, the step of packaging and transmitting the data to be transmitted to the server according to the target data transmission format corresponding to the target data transmission protocol includes: According to the target data transmission format corresponding to the target data transmission protocol, the data to be transmitted is packaged to generate a corresponding executable file; By performing a joint debugging test on the executable file with the server, a corresponding test result is generated; When it is determined according to the test result that the test passes, the executable file is transmitted to the server.

[0062] Specifically, the executable file may be a .jar file, or a .jar package.

[0063] In the embodiment of this specification, after the data to be transmitted is packaged according to the target data transmission format to generate the corresponding .jar file, the .jar file can be tested with the server; if the test passes, the .jar file can be directly transmitted to the server. Since the .jar file is executable, the corresponding command can be used to start the program to report data.

[0064] If the test fails, an error log will be generated. The user can view the error log to determine the specific reason for the test failure and adjust the relevant content, and then re-package the data to be transmitted according to the target data transmission format to generate the corresponding .jar file, and continue to perform the joint debugging test steps.

[0065] The overall architecture of the embodiment of this specification is written in JAVA, using the springBoot+mybatis framework, the configuration file can be dynamically configured, and the mysql database is integrated to dynamically manage different power stations and complete multi-threaded data reporting.

[0066] The embodiments of this specification first integrate and develop various data transmission protocols, and then dynamically load the data format and data points of each data transmission protocol into a database or configuration file in the form of parameters, and dynamically add the aggregation platform that the client needs to access through configuration. Through this processing method, in the case of multiple data transmission protocols, only one protocol integration program needs to be developed without additional code development, and it can be maintained through one project, which reduces maintenance costs; in the case of new protocols, it is only necessary to integrate the new protocol into the protocol integration program, which is flexible and effective. In addition, when the client needs to report data to multiple servers, the client can adopt a multi-threaded approach, which is conducive to improving the efficiency of data transmission, and the data reported to different servers can be stored in the client through the shared JVM memory, which is conducive to saving storage space.

[0067] The data processing method provided in the embodiments of the present specification responds to a data transmission request for a server and calls a target interface to identify the interface type and target data transmission protocol of the server; when it is determined that the interface type matches the target interface according to the identification result, a configuration file corresponding to the target data transmission protocol is queried in a database; a mapping relationship between the target data transmission protocol stored in the configuration file and the storage location of the data to be transmitted in the database is obtained, and the data to be transmitted is read in the database according to the storage location; and the data to be transmitted is packaged and transmitted to the server according to the target data transmission format corresponding to the target data transmission protocol.

[0068] In the embodiments of the present specification, the client integrates multiple data transmission protocols into a protocol integration program, and then configures the relevant data of each data transmission protocol to generate a corresponding configuration file and stores it, so that the target interface of the client can support multiple data transmission protocols. Later, when the client needs to report data to the server, it can directly identify the interface type of the server, and when it is determined that the interface type matches the target interface, it means that the client can use the same data transmission protocol as the server to communicate with it. In this case, the subsequent configuration file query, reading, packaging and transmission of the data to be transmitted can be directly performed by executing the protocol integration program without doing additional code development, which is not only conducive to reducing the resource consumption of program development, but also conducive to improving the query acquisition and calling efficiency of the communication protocol, thereby helping to improve the data transmission efficiency.

[0069] The following combination Figure 3 , taking the application of the data processing method provided in this specification in an energy storage power station as an example, the data processing method is further described. Figure 3 A processing flow chart of a data processing method provided by an embodiment of the present specification is shown, which specifically includes the following steps.

[0070] Step 302: Receive the input aggregation platform identification information and the communication protocol information of the aggregation platform.

[0071] Step 304: Check the protocol type.

[0072] Specifically, it is verified whether the communication protocol of the server is the same as one of the multiple data communication protocols supported by the energy storage power station client.

[0073] Step 306: Determine whether the verification is passed.

[0074] If yes, execute step 308 ; if no, execute step 324 .

[0075] Specifically, if the communication protocol of the server is the same as one of the multiple data communication protocols supported by the energy storage power station client, the verification passes; if the communication protocol of the aggregation platform is different from any of the multiple data communication protocols supported by the energy storage power station client, the verification fails.

[0076] Step 308: By executing the protocol integration program, the configuration file corresponding to the communication protocol is searched in the database.

[0077] Step 310: Obtain a mapping relationship between the communication protocol stored in the configuration file and the storage location of the data to be transmitted in the database, and read the data to be transmitted in the database according to the storage location.

[0078] Step 312: Pack the data to be transmitted into a corresponding executable file according to the message format corresponding to the communication protocol.

[0079] Step 314: Perform joint debugging test on the executable file through the aggregation platform.

[0080] Step 316: Determine whether the test is passed.

[0081] If yes, execute step 318 ; if no, execute step 320 .

[0082] Step 318: Transmit the executable file to the aggregation platform.

[0083] Step 320: Output an error log indicating that the test failed.

[0084] Step 322: In response to the packing instruction, the data to be transmitted is repacked according to the message format corresponding to the communication protocol to generate a corresponding executable file.

[0085] After step 322 is completed, step 314 is continued.

[0086] Step 324: Output interface mismatch alarm information.

[0087] Step 326: Add relevant configurations of the communication protocol and relevant configurations of the message format of the communication protocol.

[0088] Specifically, after step 326 is completed, step 302 is continued.

[0089] In the embodiments of this specification, the energy storage power station client integrates multiple data transmission protocols into a protocol integration program, and then configures the relevant data of each data transmission protocol to generate a corresponding configuration file and stores it, so that the energy storage power station client can support multiple data transmission protocols. Later, when there is a need to report data to the aggregation platform, the protocol type of the aggregation platform can be directly verified; if the verification passes, it means that the energy storage power station client can use the same data transmission protocol as the aggregation platform to communicate with it. In this case, the subsequent configuration file query, reading, packaging and transmission of the data to be transmitted can be directly performed by executing the protocol integration program without additional code development. This is not only conducive to reducing the resource consumption of program development, but also conducive to improving the query, acquisition and call efficiency of the communication protocol, thereby improving the data transmission efficiency.

[0090] Corresponding to the above method embodiment, this specification also provides a data processing device embodiment, Figure 4 FIG. 1 is a schematic diagram showing the structure of a data processing device provided by an embodiment of the present specification. Figure 4 As shown, the device comprises: The identification module 402 is configured to call a target interface to identify the interface type and target data transmission protocol of the server in response to a data transmission request to the server; A query module 404 is configured to query a configuration file corresponding to the target data transmission protocol in a database when it is determined according to the identification result that the interface type matches the target interface; The acquisition module 406 is configured to acquire a mapping relationship between the target data transmission protocol stored in the configuration file and a storage location of the data to be transmitted in the database, and read the data to be transmitted in the database according to the storage location; The transmission module 408 is configured to package the data to be transmitted and transmit it to the server according to the target data transmission format corresponding to the target data transmission protocol.

[0091] Optionally, the transmission module 408 is further configured to: According to the target data transmission format corresponding to the target data transmission protocol, the data to be transmitted is packaged to generate a corresponding executable file; By performing a joint debugging test on the executable file with the server, a corresponding test result is generated; When it is determined according to the test result that the test passes, the executable file is transmitted to the server.

[0092] Optionally, the data processing device further includes a processing module 410 configured to: In the case where it is determined according to the identification result that the interface type does not match the target interface, configuring the protocol parameters of the target data transmission protocol and the target data transmission format to generate a corresponding configuration file; Determine the data to be transmitted according to the target data transmission format, and determine the storage location of the data to be transmitted in the database; A mapping relationship between the storage location and the target data transmission protocol is established, the mapping relationship is stored in the configuration file, and the configuration file is stored in the database.

[0093] Optionally, the processing module 410 is further configured to: Obtain at least two data transmission protocols, and obtain protocol parameters and a data transmission format of each data transmission protocol; A protocol integration program of the at least two data transmission protocols is compiled according to the protocol identifier of each data transmission protocol, the protocol parameters and the data transmission format.

[0094] Optionally, the processing module 410 is further configured to: In the case where it is determined according to the identification result that the interface type does not match the target interface, determining target protocol parameters of the target data transmission protocol; Compiling a protocol subroutine of the target data transmission protocol according to the protocol identifier of the target data transmission protocol, the target protocol parameters and the target data transmission format; Add the protocol subprogram to the protocol integration program.

[0095] Optionally, the query module 404 is further configured to: By executing the protocol integration program, a configuration file corresponding to the target data transmission protocol is queried in a database.

[0096] Optionally, the processing module 410 is further configured to: Comparing a target data transmission format corresponding to the target data transmission protocol with a data transmission format included in the configuration file; In case of inconsistency in the comparison, the configuration file is updated based on the target data transmission format.

[0097] The above is a schematic scheme of a data processing device of this embodiment. It should be noted that the technical scheme of the data processing device and the technical scheme of the above data processing method belong to the same concept, and the details of the technical scheme of the data processing device that are not described in detail can be referred to the description of the technical scheme of the above data processing method.

[0098] Figure 5The structure block diagram of a computing device 500 provided according to an embodiment of the present specification is shown. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and the database 550 is used to store data.

[0099] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0100] In one embodiment of the present specification, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0101] Computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 500 may also be a mobile or stationary server.

[0102] The processor 520 is used to execute the following computer executable instructions, which implement the steps of the above data processing method when executed by the processor.

[0103] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above data processing method.

[0104] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above-mentioned data processing method when executed by a processor.

[0105] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above data processing method.

[0106] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned data processing method.

[0107] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be referred to the description of the technical scheme of the above data processing method.

[0108] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0109] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0110] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0111] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0112] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A data processing method, comprising: In response to a data transmission request for a server, calling a target interface to identify an interface type of the server and a target data transmission protocol; When it is determined according to the identification result that the interface type matches the target interface, querying a configuration file corresponding to the target data transmission protocol in a database; Acquire a mapping relationship between the target data transmission protocol stored in the configuration file and a storage location of the data to be transmitted in the database, and read the data to be transmitted in the database according to the storage location; The data to be transmitted is packaged and transmitted to the server according to the target data transmission format corresponding to the target data transmission protocol.

2. The data processing method according to claim 1, wherein the step of packaging and transmitting the data to be transmitted to the server according to the target data transmission format corresponding to the target data transmission protocol comprises: According to the target data transmission format corresponding to the target data transmission protocol, the data to be transmitted is packaged to generate a corresponding executable file; By performing a joint debugging test on the executable file with the server, a corresponding test result is generated; When it is determined according to the test result that the test passes, the executable file is transmitted to the server.

3. The data processing method according to claim 1, further comprising: In the case where it is determined according to the identification result that the interface type does not match the target interface, configuring the protocol parameters of the target data transmission protocol and the target data transmission format to generate a corresponding configuration file; Determine the data to be transmitted according to the target data transmission format, and determine the storage location of the data to be transmitted in the database; A mapping relationship between the storage location and the target data transmission protocol is established, the mapping relationship is stored in the configuration file, and the configuration file is stored in the database.

4. The data processing method according to claim 1, further comprising: Obtain at least two data transmission protocols, and obtain protocol parameters and a data transmission format of each data transmission protocol; A protocol integration program of the at least two data transmission protocols is compiled according to the protocol identifier of each data transmission protocol, the protocol parameters and the data transmission format.

5. The data processing method according to claim 4, further comprising: In the case where it is determined according to the identification result that the interface type does not match the target interface, determining target protocol parameters of the target data transmission protocol; Compiling a protocol subroutine of the target data transmission protocol according to the protocol identifier of the target data transmission protocol, the target protocol parameters and the target data transmission format; Add the protocol subprogram to the protocol integration program.

6. The data processing method according to claim 4 or 5, wherein the step of querying a database for a configuration file corresponding to the target data transmission protocol comprises: By executing the protocol integration program, a configuration file corresponding to the target data transmission protocol is queried in a database.

7. The data processing method according to claim 1, after querying the configuration file corresponding to the target data transmission protocol in the database, further comprising: Comparing a target data transmission format corresponding to the target data transmission protocol with a data transmission format included in the configuration file; In case of inconsistency in the comparison, the configuration file is updated based on the target data transmission format.

8. A data processing device, comprising: an identification module, configured to, in response to a data transmission request for a server, call a target interface to identify an interface type and a target data transmission protocol of the server; A query module configured to query a configuration file corresponding to the target data transmission protocol in a database when it is determined according to the identification result that the interface type matches the target interface; an acquisition module, configured to acquire a mapping relationship between the target data transmission protocol stored in the configuration file and a storage location of the data to be transmitted in the database, and read the data to be transmitted in the database according to the storage location; The transmission module is configured to package the data to be transmitted and transmit it to the server according to the target data transmission format corresponding to the target data transmission protocol.

9. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the data processing method described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the data processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Communication protocol switching method, apparatus and system

    CN106453334A

  • Data transmission method and device, equipment and medium

    CN113938531A

  • Protocol analysis method and device and computer readable storage medium

    CN114640727A

  • Data transmission method and system based on hydrological protocol, terminal and medium

    CN115967708A

  • Centralized meter reading method, centralized meter reading system and electronic equipment

    CN117499813A