CN117978792A - Interaction method, device, equipment and medium of application program and Web terminal - Google Patents

Interaction method, device, equipment and medium of application program and Web terminal Download PDF

Info

Publication number
CN117978792A
CN117978792A CN202410374494.3A CN202410374494A CN117978792A CN 117978792 A CN117978792 A CN 117978792A CN 202410374494 A CN202410374494 A CN 202410374494A CN 117978792 A CN117978792 A CN 117978792A
Authority
CN
China
Prior art keywords
web service
web
application program
request information
interaction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410374494.3A
Other languages
Chinese (zh)
Inventor
吕鹏凌
仇成丰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shuangyili Ningbo Battery Co ltd
Original Assignee
Shuangyili Ningbo Battery Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shuangyili Ningbo Battery Co ltd filed Critical Shuangyili Ningbo Battery Co ltd
Priority to CN202410374494.3A priority Critical patent/CN117978792A/en
Publication of CN117978792A publication Critical patent/CN117978792A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the application provides an interaction method, device, equipment and medium of an application program and a Web end, relating to the technical field of data interaction, wherein the method comprises the following steps: responding to first request information output by the Web terminal; transmitting the first request information to a Web service, and transmitting the first request information to an application program by the Web service through a Modbus protocol, wherein the Web service is established by adopting an Express framework; and responding to response information returned after the application program executes the first request information, transmitting the response information to the Web service through a Modbus protocol, and feeding back the response information to the Web terminal by the Web service. The application adopts the Web service established by the Express framework to interact through the Modbus protocol, so that data overflow can be avoided, and the maintenance cost of an interaction system is reduced.

Description

Interaction method, device, equipment and medium of application program and Web terminal
Technical Field
The present application relates to the field of data interaction technologies, and in particular, to a method, an apparatus, a device, and a medium for interaction between an application program and a Web terminal.
Background
The EMS (ENGINE MANAGEMENT SYSTEM ) is an embedded system in the vehicle that is responsible for monitoring and controlling various parameters of the engine, and is a core component of the vehicle. Currently, an application program in an EMS mainly depends on a back-end program to interact with a Web end, wherein the back-end program mainly adopts a program in an ESP (Electronic Stability Program, vehicle stability control system), and information interaction between the application program and the back-end program depends on a message queue.
On the one hand, however, due to the limited data volume that can be transmitted each time in the message queue, when the data volume requested by the Web terminal exceeds the limit of the message queue, the situation of data overflow occurs; on the other hand, depending on the interaction between the travel communication between the application program and the back-end program and the Web end, the whole link between the EMS and the ESP needs to be tested or maintained when the interaction process is wrong, and the maintenance cost is high.
Disclosure of Invention
One or more embodiments of the present application provide a method, an apparatus, a device, and a medium for interaction between an application program and a Web terminal, so as to solve or at least partially solve the problems in the prior art that data overflow easily occurs and maintenance cost is high.
In a first aspect, the present application provides a method for interaction between an application program and a Web terminal, including:
responding to first request information output by the Web terminal;
Transmitting the first request information to a Web service, and transmitting the first request information to an application program by the Web service through a Modbus protocol, wherein the Web service is established by adopting an Express framework;
And responding to response information returned after the application program executes the first request information, transmitting the response information to the Web service through a Modbus protocol, and feeding back the response information to the Web terminal by the Web service.
Optionally, the interaction method between the application program and the Web terminal further comprises:
Responding to second request information output by the Web terminal;
And transmitting the second request information to the Web service, and accessing or operating a database by the Web service according to the second request information, wherein the database stores relevant information of the application program.
Optionally, after the Web service transmits the first request information to an application program through a Modbus protocol, the method for interaction between the application program and the Web terminal further includes:
designating an internet protocol address and a port number according to a transmission control protocol/internet protocol through the Web service to determine a Modbus point location;
when the instruction type of the first request information is a reading instruction, reading the data of the Modbus point location as the response information;
And when the instruction type of the first request information is a writing instruction, writing the first request information into the Modbus point location.
Optionally, the interaction method between the application program and the Web terminal further comprises: and when at least one of the problems that the data cannot be written into or read from the Modbus protocol address correctly but the read data is incorrect and the information stored in the database is incorrect occurs in the interaction process, modifying the application program.
Optionally, the interaction method between the application program and the Web terminal further comprises: and when the interaction process has errors of reading Modbus protocol addresses and Modbus protocols are not wrong, and/or the interaction process has errors of reading data from a database and the database is not wrong, modifying the program of the Web service.
Optionally, the accessing or operating, by the Web service, the database according to the second request information includes:
Establishing a connection pool with the database according to the authentication information, and establishing connection between the Web service and the connection pool;
based on the connection between the Web service and the connection pool, inquiring corresponding data in the database according to the second request information;
And feeding the queried data back to the Web service, and closing the connection pool.
Optionally, the transmitting, by the Web service, the first request information to an application program through a Modbus protocol includes:
Establishing Modbus TCP connection, and detecting whether the connection is successful or not through a Modbus port;
if yes, the first request information is transmitted to the application program through a Modbus protocol.
In a second aspect, the present invention provides an interaction device between an application program and a Web terminal, including:
The response module is used for responding to the first request information output by the Web terminal;
The request module is used for transmitting the first request information to Web service, and the Web service transmits the first request information to an application program through Modbus protocol, wherein the Web service is established by adopting an Express framework;
And the response module is used for responding to response information returned after the application program executes the first request information, transmitting the response information to the Web service through a Modbus protocol, and feeding back the response information to the Web terminal through the Web service.
In a third aspect, the present invention provides an electronic device comprising a processor and a storage medium;
the storage medium is used for storing a computer program;
the processor is configured to implement the interaction method between the application program and the Web terminal according to the first aspect when executing the computer program.
In a fourth aspect, the present invention provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method for interaction of an application program with a Web terminal according to the first aspect.
The interaction method, device, equipment and medium of the application program and the Web end of one or more embodiments of the application have the beneficial effects that:
When the Web end outputs the first request information, the Web service transmits the first request information to the application program by utilizing a Modbus protocol. And the application program executes corresponding operation after receiving the first request information and feeds back response information. And feeding back response information to the Web service through the Modbus protocol, and feeding back the response information to the Web terminal by the Web service to realize interaction between the Web terminal and the application program. The Web service is built by adopting an Express framework, and the Express framework is a node. Js Web application framework, so that the Web service can interact with an application program through a Modbus protocol, data interaction is performed between the Web service and the application program through a request/response mechanism of the Modbus protocol, and compared with the situation that the Web service and the application program directly perform data communication, the logic of the Web service and the application program can be separated, the Web service and the application program can be independently developed and deployed, and when an error occurs in the interaction process, only the Web service or the application program is required to be maintained, the whole interaction link is prevented from being maintained, and the maintenance cost is effectively reduced. And the Web service and the application program carry out data interaction through a request/response mechanism of the Modbus protocol, corresponding response data is returned in a Modbus response mode only when the Modbus request is received, even if the data volume of the Web end request is increased, if the Modbus request is not received, the data is not transmitted, and therefore data overflow is not caused.
Drawings
FIG. 1 is a flow chart of an interaction method between an application program and a Web terminal according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an architecture of an interactive system between an application and a Web terminal according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating interaction between an application and Modbus according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating interaction between an application and a database according to an embodiment of the present application;
FIG. 5 is a diagram illustrating a process of executing a first request message according to an embodiment of the present application;
Fig. 6 is a schematic structural diagram of an interaction device between an application program and a Web terminal according to an embodiment of the present application.
Detailed Description
In order that the above objects, features and advantages of the application will be readily understood, a more particular description of the application will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. While the application is susceptible of embodiment in the drawings, it is to be understood that the application may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided to provide a more thorough and complete understanding of the application. It should be understood that the drawings and embodiments of the application are for illustration purposes only and are not intended to limit the scope of the present application.
It should be understood that the various steps recited in the method embodiments of the present application may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the application is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "alternative embodiments". Related definitions of other terms will be given in the description below. It should be noted that the terms "first," "second," and the like herein are merely used for distinguishing between different devices, modules, or units and not for limiting the order or interdependence of the functions performed by such devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those skilled in the art will appreciate that "one or more" is intended to be construed as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the devices in the embodiments of the present application are for illustrative purposes only and are not intended to limit the scope of such messages or information.
As shown in fig. 1 to fig. 3, an interaction method between an application program and a Web terminal provided by one or more embodiments of the present application may be applied to a terminal side (specifically, a server or a computer, etc.) where a Web service is located, and includes:
S100, responding to first request information output by the Web terminal.
In particular, the first request information may include a write instruction and/or a read instruction, and the first request information may further include information required by the application program. The application may be an application in an EMS.
And S200, transmitting the first request information to a Web service, and transmitting the first request information to an application program by the Web service through a Modbus protocol, wherein the Web service is established by adopting an Express framework.
Specifically, the Express framework is a fast, simple, flexible Web back-end framework for node. Js, which implements front-end and back-end communications through app. Method () basic routes, and binds front-end files or frameworks through related function Express. Static () loading static files. The embodiments of the application realize the back-end request function through the framework.
The Web Service (namely Web Service) is established by adopting the node.js Express framework, the Modbus-serial method of the node.js can be used for directly reading the Modbus, the corresponding operation can be directly carried out with the application program through the Modbus port, and the communication with the application program is realized through the Modbus protocol.
And S300, responding to response information returned after the application program executes the first request information, transmitting the response information to the Web service through a Modbus protocol, and feeding back the response information to the Web terminal by the Web service.
In particular, the Modbus protocol is an application layer messaging protocol that is commonly used to provide client/server communications between devices connected to different types of buses or networks. In addition, the Modbus protocol is a request/response protocol capable of providing services specified by function codes. Because the request/response protocol is used, and because the server and the client are the same device, the first request information can be sent to the application program at the Web end, the application program directly sends a corresponding Modbus request to the server after receiving the first request information, after the Modbus response is successfully acquired, the messages are analyzed and combined into json files in a fixed format, the json files are read and processed by the application program and returned to the Web end, and the Web end can correspondingly process the Web page according to the response information.
It should be noted that, the interaction method between the application program and the Web terminal of the present application may be used to implement interaction between the EMS (ENERGY MANAGEMENT SYSTEM ) program and the Web terminal.
In this embodiment, when the Web terminal outputs the first request information, the Web service transmits the first request information to the application program by using the Modbus protocol. And the application program executes corresponding operation after receiving the first request information and feeds back response information. And feeding back response information to the Web service through the Modbus protocol, and feeding back the response information to the Web terminal by the Web service to realize interaction between the Web terminal and the application program. The Web service is built by adopting an Express framework, and the Express framework is a node. Js Web application framework, so that the Web service can interact with an application program through a Modbus protocol, data interaction is performed between the Web service and the application program through a request/response mechanism of the Modbus protocol, and compared with the situation that the Web service and the application program directly perform data communication, the logic of the Web service and the application program can be separated, the Web service and the application program can be independently developed and deployed, and when an error occurs in the interaction process, only the Web service or the application program is required to be maintained, the whole interaction link is prevented from being maintained, and the maintenance cost is effectively reduced. And the Web service and the application program carry out data interaction through a request/response mechanism of the Modbus protocol, corresponding response data is returned in a Modbus response mode only when the Modbus request is received, even if the data volume of the Web end request is increased, if the Modbus request is not received, the data is not transmitted, and therefore data overflow is not caused.
Optionally, as shown in fig. 4, the method for interaction between the application program and the Web terminal further includes:
Responding to second request information output by the Web terminal;
And transmitting the second request information to the Web service, and accessing or operating a database by the Web service according to the second request information, wherein the database stores relevant information of the application program.
In particular, a database is a repository that organizes, stores, manages data according to a data structure, typically having one or more APIs for creating, accessing, managing, searching, copying the saved data. Because of the special property of equipment data storage, the application does not use the recommended relational database, the corresponding table of the database directly contains all data needed by the table, the data volume is larger, and the query speed is relatively slower.
The embodiment can adopt a MySQL database, support multithreading access, support self-repairing type clusters and support native json, so that the MySQL database can be directly accessed through the MySQL database of node. Js. The database is built by the program, and the Web end only reads the database data in most cases and does not modify the data in the database. The front end (namely the Web end) sends a request to the rear end, the rear end receives the request and correspondingly reads the required information from the corresponding database through the MySQL database of Nodejs, the acquired information is sent to the front end in a response mode, and the front end displays according to the response.
In this alternative embodiment, the database may be directly accessed or operated by the MySQL method of node. Js, and may be notified to the application by means of the Modbus protocol: the database is modified through the Web service, so that the Web end and the database end can respectively and independently execute the operation, and when a certain link error exists in the Web end and the database end, retests and rewrites all programs are not needed, thereby reducing the workload of system maintenance.
Optionally, after the Web service transmits the first request information to an application program through a Modbus protocol, the method for interaction between the application program and the Web terminal further includes:
Specifying, by the Web service, an IP (Internet Protocol ) address and port number according to a TCP/IP (Transmission Control Protocol/Internet Protocol ) protocol to determine a Modbus point location;
when the instruction type of the first request information is a reading instruction, reading the data of the Modbus point location as the response information;
And when the instruction type of the first request information is a writing instruction, writing the first request information into the Modbus point location.
Specifically, the Modbus protocol is established by an application program, which only establishes and monitors the Modbus protocol and does not directly communicate with the Web service. The Web service appoints an IP address and a port number to access Modbus through a TCP/IP protocol, and can display a corresponding value by reading a Modbus point location at a front-end appointed position; or the first request information is written into the corresponding writable point position of Modbus through a TCP/IP method, and the corresponding operation is monitored and executed by the application program.
As shown in fig. 5, when the instruction type of the first request information is a read instruction, the 0x03, 0x01 or 0x04 function code may be used for reading according to the actual definition. When the instruction type of the first request information is a writing instruction, a single bit is written by using a 0x06 or 0x05 function code or a plurality of bits are written by using 0x0F according to the actual definition and the actual writing bit number.
In this alternative embodiment, the Web side uses the Express framework to establish that the Web service directly accesses the Modbus or database to obtain the corresponding information, so as to implement interaction with the application program. And the Web service interacts with the application program through the Modbus protocol, and the interaction is performed by utilizing a response mechanism of the Modbus protocol, so that data overflow can be avoided compared with the interaction performed by using a message queue among programs.
Optionally, the interaction method between the application program and the Web terminal further comprises: and when at least one of the problems that the data cannot be written into or read from the Modbus protocol address correctly but the read data is incorrect and the information stored in the database is incorrect occurs in the interaction process, modifying the application program.
By way of example, the application program is an EMS program, i.e. the interaction between the EMS and the Web terminal is implemented. When the Modbus protocol address is read correctly by the Web end (and/or Web service), the fact that the numerical value in the Modbus address is inconsistent with the actual running value is confirmed by an upper computer (such as BMS (Battery MANAGEMENT SYSTEM, battery management System), PCS (Power Conversion System, inverter of energy management System) and EMS program logs (modified EMS configuration in a terminal display part log of a Tera terminal or a power shell window of an operating system (such as Windows system)) of each manufacturer, and errors occur when the EMS program reads the equipment data is confirmed, and corresponding points in the EMS program are modified, recompiled and run.
Optionally, the interaction method between the application program and the Web terminal further comprises: and when the interaction process has errors of reading Modbus protocol addresses and Modbus protocols are not wrong, and/or the interaction process has errors of reading data from a database and the database is not wrong, modifying the program of the Web service.
The Web terminal (and/or Web service) reads the Modbus protocol address error, but when the correct Modbus protocol address is read by using the Modbus pull and the data is read by using an upper computer of the equipment manufacturer, the error is not found, the read error is determined to be the read error of the Web terminal (and/or Web service), the url corresponding to the Web back-end program (i.e. Web service) is checked, if the Modbus read address in the url is wrong, the read address is modified, if the part of the back-end (i.e. the side of the Web service) is not wrong, the front-end display error is displayed, and the numerical display of the corresponding position of the front-end (i.e. the Web terminal) is modified.
The Web end (and/or Web service) reads the database and generates data errors, uses a mysql official upper computer to remotely connect, or uses a Tera terminal or a power shell window and other terminals of an operating system to connect with a gold shield and log in the mysql, can read the content of the database and does not find errors, determines that the Web data is read or displayed in error, checks the corresponding url or function of the rear end, confirms the read content (whether the reading is correct) and the content (whether the Web end is displayed correctly) sent to the front end, and modifies the corresponding position.
The method comprises the steps that a Web end (and/or Web service) reads information such as a database and a column name correctly, but cannot read related information, a mysql official upper computer is used for remote connection, or a terminal such as a Tera terminal or a power shell window of an operating system is used for connecting a golden shield and logging in the mysql to find that the database itself has errors, so that the database cannot be read or fails to log in, if the database itself is found, the database is determined to be newly built into an EMS program, or the database in the golden shield is in a certain problem, at the moment, the database needs to be further confirmed to be in error of any party, if the database cannot log in, whether the equipment memory is occupied or not needs to be checked, at the moment, operations such as initializing the database and the like need to be checked, and whether the database is checked in a hard disk, the database cleaning function is needed, and modification are needed; if the database can be accessed in a login mode, but the database construction is wrong through the correct query statement, the database construction part needs to be modified and the wrong table reconstruction table needs to be deleted at the moment.
In this optional embodiment, the Web terminal reads or writes Modbus or database through the Web service, the Modbus and the database are connected with the application program (i.e. EMS terminal), so that the Web service is prevented from directly communicating with the application program, the Web service (i.e. Web back end) and the application program (i.e. EMS terminal) are completely and independently executed respectively, when an error occurs in a link between the two, only the Web back end or EMS terminal needs to be maintained, and retesting or rewriting of programs is not needed for all links, thereby effectively reducing the workload of system maintenance.
Optionally, the accessing or operating, by the Web service, the database according to the second request information includes:
And establishing a connection pool with the database according to the authentication information, and establishing connection between the Web service and the connection pool.
Specifically, identity verification information such as a user name, a password, a local address and the like can be input through a mysql.createpool () method to establish a connection pool with a database, and connection is established to the connection pool through a pool.getconnection () method (pool is the connection pool).
And based on the connection between the Web service and the connection pool, inquiring corresponding data in the database according to the second request information.
Specifically, the connection is further manipulated by a connection () method (connection is a connection established with the current connection pool) using mysql statements, such as: connection.query (' show databases like "% ems_log%"; "is) is a query to a database whose name contains ' ems_log '.
And feeding the queried data back to the Web service, and closing the connection pool.
Specifically, after the operation is finished, a pool () (pool is a connection pool) method is used to close the corresponding connection pool, so that the database related operation cannot occupy excessive computing resources.
Optionally, the transmitting, by the Web service, the first request information to an application program through a Modbus protocol includes:
a Modbus TCP (Modbus protocol over ethernet TCP/IP) connection is established and whether the connection is successful is detected through the Modbus port.
Specifically, a client-connection TCP () method in a modbus-serial library is used to create a modbus TCP connection (the application can use only modbus TCP for connection), a client-isopen method is used to judge the port before each connection, the connection state is detected, if the port is closed, namely when the connection fails, the reconnection is attempted, and if the connection fails, an error is thrown out and the error information is sent to the front end.
If yes, the first request information is transmitted to the application program through a Modbus protocol.
Specifically, if the connection is successful, conventional modbus operations such as setting the current modbus slave ID to be read, reading data to the modbus corresponding address, or writing data to the modbus corresponding address are allowed to use the client.
As shown in fig. 6, an interaction device for an application program and a Web terminal provided in one or more embodiments of the present application includes:
The response module is used for responding to the first request information output by the Web terminal;
The request module is used for transmitting the first request information to Web service, and the Web service transmits the first request information to an application program through Modbus protocol, wherein the Web service is established by adopting an Express framework;
And the response module is used for responding to response information returned after the application program executes the first request information, transmitting the response information to the Web service through a Modbus protocol, and feeding back the response information to the Web terminal through the Web service.
The interaction device of the application program and the Web terminal in this embodiment is used to implement the interaction method of the application program and the Web terminal as described above, and the advantages of the interaction device are the same as those of the interaction device of the application program and the Web terminal in the prior art, and are not described herein.
Optionally, the response module is further configured to: responding to second request information output by the Web terminal; and transmitting the second request information to the Web service, and accessing or operating a database by the Web service according to the second request information, wherein the database stores relevant information of the application program.
Optionally, the interaction device between the application program and the Web terminal further comprises an operation module, and the operation module is used for: specifying an IP address and a port number according to a TCP/IP protocol through the Web service to determine a Modbus point location; when the instruction type of the first request information is a reading instruction, reading the data of the Modbus point location as the response information; and when the instruction type of the first request information is a writing instruction, writing the first request information into the Modbus point location.
Optionally, the interaction device between the application program and the Web terminal further includes a maintenance module, where the maintenance module is configured to: and when at least one of the problems that the data cannot be written into or read from the Modbus protocol address correctly but the read data is incorrect and the information stored in the database is incorrect occurs in the interaction process, modifying the application program.
Optionally, the maintenance module is further configured to: and when the interaction process has errors of reading Modbus protocol addresses and Modbus protocols are not wrong, and/or the interaction process has errors of reading data from a database and the database is not wrong, modifying the program of the Web service.
Optionally, the response module is specifically further configured to: establishing a connection pool with the database according to the authentication information, and establishing connection between the Web service and the connection pool; based on the connection between the Web service and the connection pool, inquiring corresponding data in the database according to the second request information; and feeding the queried data back to the Web service, and closing the connection pool.
Optionally, the request module is specifically configured to: establishing Modbus TCP connection, and detecting whether the connection is successful or not through a Modbus port; if yes, the first request information is transmitted to the application program through a Modbus protocol.
An electronic device provided by one or more embodiments of the present application includes a processor and a storage medium; the storage medium is used for storing a computer program; the processor is configured to implement the interaction method between the application program and the Web terminal as described above when executing the computer program.
One or more embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements a method for interaction of an application program with a Web terminal as described above.
An electronic device that can be a server or a client of the present application will now be described, which is an example of a hardware device that can be applied to aspects of the present application. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
The electronic device includes a computing unit that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) or a computer program loaded from a storage unit into a Random Access Memory (RAM). In the RAM, various programs and data required for the operation of the device may also be stored. The computing unit, ROM and RAM are connected to each other by a bus. An input/output (I/O) interface is also connected to the bus.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like. In the present application, the units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present application. In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
Although the application is disclosed above, the scope of the application is not limited thereto. Various changes and modifications may be made by one skilled in the art without departing from the spirit and scope of the application, and these changes and modifications will fall within the scope of the application.

Claims (10)

1. An interaction method between an application program and a Web terminal is characterized by comprising the following steps:
responding to first request information output by the Web terminal;
Transmitting the first request information to a Web service, and transmitting the first request information to an application program by the Web service through a Modbus protocol, wherein the Web service is established by adopting an Express framework;
And responding to response information returned after the application program executes the first request information, transmitting the response information to the Web service through a Modbus protocol, and feeding back the response information to the Web terminal by the Web service.
2. The method for interaction between an application program and a Web terminal according to claim 1, further comprising:
Responding to second request information output by the Web terminal;
And transmitting the second request information to the Web service, and accessing or operating a database by the Web service according to the second request information, wherein the database stores relevant information of the application program.
3. The method for interaction between an application and a Web terminal according to claim 1, wherein after the Web service transmits the first request information to the application through a Modbus protocol, the method for interaction between the application and the Web terminal further comprises:
designating an internet protocol address and a port number according to a transmission control protocol/internet protocol through the Web service to determine a Modbus point location;
when the instruction type of the first request information is a reading instruction, reading the data of the Modbus point location as the response information;
And when the instruction type of the first request information is a writing instruction, writing the first request information into the Modbus point location.
4. A method of interaction between an application and a Web site according to any one of claims 1 to 3, further comprising: and when at least one of the problems that the data cannot be written into or read from the Modbus protocol address correctly but the read data is incorrect and the information stored in the database is incorrect occurs in the interaction process, modifying the application program.
5. The method for interaction between an application and a Web terminal according to claim 4, further comprising: and when the interaction process has errors of reading Modbus protocol addresses and Modbus protocols are not wrong, and/or the interaction process has errors of reading data from a database and the database is not wrong, modifying the program of the Web service.
6. The method for interaction between an application program and a Web terminal according to claim 2, wherein the accessing or operating the database by the Web service according to the second request information comprises:
Establishing a connection pool with the database according to the authentication information, and establishing connection between the Web service and the connection pool;
based on the connection between the Web service and the connection pool, inquiring corresponding data in the database according to the second request information;
And feeding the queried data back to the Web service, and closing the connection pool.
7. A method of interaction between an application and a Web site according to any one of claims 1 to 3, wherein the transmitting, by the Web service, the first request message to the application via the Modbus protocol comprises:
Establishing Modbus TCP connection, and detecting whether the connection is successful or not through a Modbus port;
if yes, the first request information is transmitted to the application program through a Modbus protocol.
8. An application program and Web terminal interaction device, comprising:
The response module is used for responding to the first request information output by the Web terminal;
The request module is used for transmitting the first request information to Web service, and the Web service transmits the first request information to an application program through Modbus protocol, wherein the Web service is established by adopting an Express framework;
And the response module is used for responding to response information returned after the application program executes the first request information, transmitting the response information to the Web service through a Modbus protocol, and feeding back the response information to the Web terminal through the Web service.
9. An electronic device comprising a processor and a storage medium;
the storage medium is used for storing a computer program;
The processor is configured to implement the method for interaction between an application program and a Web terminal according to any one of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, wherein a computer program is stored on the storage medium, which when executed by a processor, implements a method of interaction of an application program with a Web-side according to any of claims 1 to 7.
CN202410374494.3A 2024-03-29 2024-03-29 Interaction method, device, equipment and medium of application program and Web terminal Pending CN117978792A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410374494.3A CN117978792A (en) 2024-03-29 2024-03-29 Interaction method, device, equipment and medium of application program and Web terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410374494.3A CN117978792A (en) 2024-03-29 2024-03-29 Interaction method, device, equipment and medium of application program and Web terminal

Publications (1)

Publication Number Publication Date
CN117978792A true CN117978792A (en) 2024-05-03

Family

ID=90848206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410374494.3A Pending CN117978792A (en) 2024-03-29 2024-03-29 Interaction method, device, equipment and medium of application program and Web terminal

Country Status (1)

Country Link
CN (1) CN117978792A (en)

Similar Documents

Publication Publication Date Title
US10574724B2 (en) Automatic discovery of management nodes and generation of CLI using HA module
US9374417B1 (en) Dynamic specification auditing for a distributed system
CN111064626B (en) Configuration updating method, device, server and readable storage medium
CN112527647B (en) NS-3-based Raft consensus algorithm test system
US9448827B1 (en) Stub domain for request servicing
US11513830B2 (en) Introspection into workloads running within virtual machines
CA2424696C (en) System and method for communication with host internal area access
CN111800511B (en) Synchronous login state processing method, system, equipment and readable storage medium
EP3740869A1 (en) Automated distribution of models for execution on a non-edge device and an edge device
CN109189652A (en) A kind of acquisition method and system of close network terminal behavior data
CN111049913B (en) Data file transmission method and device, storage medium and electronic equipment
JP2021505989A (en) Methods for error handling, computer programs, data processing systems, and error handling components
CN117978792A (en) Interaction method, device, equipment and medium of application program and Web terminal
CN112181930B (en) File management method and device for virtual switching matrix
US9069619B2 (en) Self-testable HA framework library infrastructure
CN111708568B (en) Modularized development decoupling method and terminal
CN112910910A (en) Method, device, equipment and storage medium for processing OPCDA protocol message
CN113542323A (en) Service processing method, device, equipment and computer readable storage medium
CN114640585B (en) Resource updating method and device, electronic equipment and storage medium
CN117707651B (en) Interface resource operation method and system based on embedded Linux system
US11893589B2 (en) Automated support query
CN114531315B (en) Information scheduling method and scheduling device for bus information chain
WO2023230797A1 (en) Cross-system test method and apparatus
US20230091903A1 (en) Iterative generation of hypertext transfer protocol traffic
CN111013157A (en) Game loading method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication