CN112685667A - Data interaction method and device, computer readable medium and interaction server - Google Patents

Data interaction method and device, computer readable medium and interaction server Download PDF

Info

Publication number
CN112685667A
CN112685667A CN202011590506.4A CN202011590506A CN112685667A CN 112685667 A CN112685667 A CN 112685667A CN 202011590506 A CN202011590506 A CN 202011590506A CN 112685667 A CN112685667 A CN 112685667A
Authority
CN
China
Prior art keywords
data
request
database
target
parameters
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
CN202011590506.4A
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.)
Inspur Software Technology Co Ltd
Original Assignee
Inspur Software Technology 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 Inspur Software Technology Co Ltd filed Critical Inspur Software Technology Co Ltd
Priority to CN202011590506.4A priority Critical patent/CN112685667A/en
Publication of CN112685667A publication Critical patent/CN112685667A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a data interaction method, a data interaction device, a computer readable medium and an interaction server. The method comprises the following steps: receiving a data request in a JSON data format sent by a page end through a network server; triggering a Common Gateway Interface (CGI) program when the network server receives the data request; the CGI program acquires request parameters from a global variable according to the request mode of the data request, processes the request parameters and sends the request parameters to an operation, maintenance and management (OAM) end; the OAM end calls an interface of the database and sends the request parameters after format conversion to the database; the database returns data to the CGI program through the OAM end according to the request parameters; and the CGI program sends the returned data to the page end through the network server for rendering. The scheme of the invention can realize data interaction between the page and the database under the condition of limited memory space.

Description

Data interaction method and device, computer readable medium and interaction server
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data interaction method, an apparatus, a computer-readable medium, and an interaction server.
Background
At present, a JavaScript script replaces an interface written by an HTML language, and is different from the prior art that a server reloads a page when processing each request.
However, the memory space occupied by building the server is increased by the reference of the JavaScript script, and data interaction between the page and the database cannot be performed through the JavaScript under the condition of limited environment memory.
Therefore, a method is needed to implement data interaction between a page and a database under the condition of limited memory space.
Disclosure of Invention
The embodiment of the invention provides a data interaction method, a data interaction device, a computer readable medium and an interaction server, which can realize data interaction between a page and a database under the condition of limited memory space.
In a first aspect, an embodiment of the present invention provides a data interaction method, applied to an interaction server, including:
receiving a data request in a JSON data format sent by a page end through a network server;
triggering a Common Gateway Interface (CGI) program when the network server receives the data request; the CGI program acquires request parameters from a global variable according to the request mode of the data request, processes the request parameters and sends the request parameters to an operation, maintenance and management (OAM) end;
the OAM end calls an interface of the database and sends the request parameters after format conversion to the database;
the database returns data to the CGI program through the OAM end according to the request parameters;
and the CGI program sends the returned data to the page end through the network server for rendering.
Preferably, the first and second electrodes are formed of a metal,
the type of the data request comprises any one of inquiry, addition, deletion and modification;
when the type of the data request is query, the request mode in the data request is get, and the data request carries the code number and the query type identifier of the target data to be queried;
when the type of the data request is increased, the request mode in the data request is post, the QUERY _ STRING value carried by the data request is the code number and the increased type identification of the target data serving as an increased target, and the body field comprises increased content;
when the type of the data request is deletion, the request mode in the data request is post, the QUERY _ STRING value carried by the data request is the code number and the deletion type identification of the target data serving as a deletion target, and the body field comprises the information primary key value needing to be deleted;
when the type of the data request is modification, the request mode in the data request is post, the QUERY _ STRING value carried by the data request is the code number and the modification type identification of the target data serving as a modification target, and the body field comprises the information primary key value needing to be modified and the corresponding modification parameter.
Preferably, the first and second electrodes are formed of a metal,
the obtaining request parameters from the global variables according to the request mode of the data request includes:
reading a type identifier contained in the data request;
determining a target request mode according to the type identifier;
decapsulating the QUERY _ STRING value and the parameters in the body field in the data request from the target request mode;
and packaging the unpacked parameters into a format supported by the database to obtain the request parameters.
Preferably, the first and second electrodes are formed of a metal,
the database returns data to the CGI program through the OAM terminal according to the request parameter, including:
the database calls an sql statement to read a QUERY _ STRING value and a body field in the request parameter;
judging whether the data can be successfully called or not according to the QUERY _ STRING value and the body field;
if the data can be successfully called, the called data and a successful identifier indicating that the execution result is successful are sent to the CGI program through the OAM end;
and if the data cannot be successfully called, sending a failure identifier representing that the execution result is failure and a code corresponding to the failure reason to the CGI program through the OAM terminal.
Preferably, the first and second electrodes are formed of a metal,
the CGI program sends the returned data to the page side through the web server for rendering, including:
the CGI program packages the returned data into a JSON data format;
analyzing the returned data in the JSON data format to obtain form configuration information of a target form corresponding to the returned data, wherein the form configuration information represents the layout style and the data configuration information of the target form;
and rendering the form component of the target form from a component library according to the form configuration information, and rendering the target form at the page end.
In a second aspect, an embodiment of the present invention provides an interaction server based on the method provided in any one of the first aspects, including: the system comprises a network server, a CGI program, an OAM end and a database;
the network server is used for receiving a data request in a JSON data format sent by the page terminal; triggering a Common Gateway Interface (CGI) program when the data request is received; the CGI program is used for acquiring request parameters from a global variable according to a request mode of the data request; processing the request parameter and sending the request parameter to an operation, maintenance and management (OAM) end;
the OAM end is used for calling an interface of the database and sending the request parameters after format conversion to the database;
the database is used for returning data to the CGI program through the OAM end according to the request parameters;
and the CGI program is also used for sending the returned data to the page end through the network server for rendering.
Preferably, the first and second electrodes are formed of a metal,
when executing the request parameter obtained from the global variable according to the request mode of the data request, the network server specifically executes:
reading a type identifier contained in the data request;
determining a target request mode according to the type identifier;
decapsulating the QUERY _ STRING value and the parameters in the body field in the data request from the target request mode;
and packaging the unpacked parameters into a format supported by the database to obtain the request parameters.
Preferably, the first and second electrodes are formed of a metal,
the CGI program, when executing sending the returned data to the page side through the web server for rendering, specifically executes:
packaging the returned data into a JSON data format;
analyzing the returned data in the JSON data format to obtain form configuration information of a target form corresponding to the returned data, wherein the form configuration information represents the layout style and the data configuration information of the target form;
and rendering the form component of the target form from a component library according to the form configuration information, and rendering the target form at the page end.
In a third aspect, an embodiment of the present invention provides a data interaction apparatus, including: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is configured to invoke the machine-readable program to perform the method provided in any of the above first aspects.
In a fourth aspect, embodiments of the present invention provide a computer-readable medium having stored thereon computer instructions, which, when executed by a processor, cause the processor to perform the method provided in any of the first aspects.
The embodiment of the invention provides a data interaction method, a data interaction device, a computer readable medium and an interaction server. According to the technical scheme, the webpage end can open the webpage to interact with the network server, the data request in the JSON data format is sent to the network server, and the network server triggers the common gateway interface CGI program after receiving the data request. The CGI program acquires request parameters from a global variable according to the request mode of the data request, processes the request parameters and sends the request parameters to an operation, maintenance and management (OAM) end; and after receiving the request parameters, the OAM terminal calls an interface of the database and sends the interface to the database. After receiving the request parameters, the database returns data to the CGI program through the OAM end; and the CGI program sends the returned data to the page end through the network server for rendering. Therefore, in order to solve the problems that the environment memory is limited and a java or python dependent library cannot be installed, the interaction between the page and the database is realized under the condition that the java or python is not needed, the data request is processed by using a CGI program by using a network server, the occupied memory is small, the efficiency is high, the operation of the page request database can be completed in a simple mode, the returned data is sent back to the page to be rendered, and the data interaction between the page and the database can be realized under the condition that the memory space is limited by simply and efficiently establishing a communication link between the page and the database.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart of a data interaction method according to an embodiment of the present invention;
FIG. 2 is a diagram of a data interaction architecture provided by an embodiment of the present invention;
fig. 3 is a schematic diagram of an interaction server according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
Most of the previous web servers adopt an HTML language to write interfaces, and the server needs to reload the web pages when processing each request, so that the response speed is low, the user experience is poor, and particularly in the age with slow network speed. Later, developers use a JavaScript script which is highly interactive with the server, so that a better local refreshing effect is realized, and the interaction experience of users is better.
However, the introduction of the JavaScript script increases the memory space occupied by the server, which is not suitable for some environments with limited memory space.
The following describes a data interaction method, an apparatus, a computer-readable medium, and an interaction server according to various embodiments of the present invention in detail with reference to the accompanying drawings.
As shown in fig. 1, an embodiment of the present invention provides a data interaction method, which is applied to an interaction server, and the method includes the following steps:
step 101: receiving a data request in a JSON data format sent by a page end through a network server;
step 102: triggering a Common Gateway Interface (CGI) program when the network server receives the data request;
step 103: the CGI program acquires request parameters from a global variable according to the request mode of the data request, processes the request parameters and sends the request parameters to an operation, maintenance and management (OAM) end;
step 104: the OAM end calls an interface of the database and sends the request parameters after format conversion to the database;
step 105: the database returns data to the CGI program through the OAM end according to the request parameters;
step 106: and the CGI program sends the returned data to the page end through the network server for rendering.
According to the technical scheme, the webpage end can open the webpage to interact with the network server, the data request in the JSON data format is sent to the network server, and the network server triggers the common gateway interface CGI program after receiving the data request. The CGI program acquires request parameters from a global variable according to the request mode of the data request, processes the request parameters and sends the request parameters to an operation, maintenance and management (OAM) end; and after receiving the request parameters, the OAM terminal calls an interface of the database and sends the interface to the database. After receiving the request parameters, the database returns data to the CGI program through the OAM end; and the CGI program sends the returned data to the page end through the network server for rendering. Therefore, in order to solve the problems that the environment memory is limited and a java or python dependent library cannot be installed, the interaction between the page and the database is realized under the condition that the java or python is not needed, the data request is processed by using a CGI program by using a network server, the occupied memory is small, the efficiency is high, the operation of the page request database can be completed in a simple mode, the returned data is sent back to the page to be rendered, and the data interaction between the page and the database can be realized under the condition that the memory space is limited by simply and efficiently establishing a communication link between the page and the database.
In the embodiment of the present invention, the type of the data request includes any one of query, addition, deletion, and modification;
when the type of the data request is query, the request mode in the data request is get, and the data request carries the code number and the query type identifier of the target data to be queried;
when the type of the data request is increased, the request mode in the data request is post, the QUERY _ STRING value carried by the data request is the code number and the increased type identification of the target data serving as an increased target, and the body field comprises increased content;
when the type of the data request is deletion, the request mode in the data request is post, the QUERY _ STRING value carried by the data request is the code number and the deletion type identification of the target data serving as a deletion target, and the body field comprises the information primary key value needing to be deleted;
when the type of the data request is modification, the request mode in the data request is post, the QUERY _ STRING value carried by the data request is the code number and the modification type identification of the target data serving as a modification target, and the body field comprises the information primary key value needing to be modified and the corresponding modification parameter.
Specifically, the scheme of the invention aims to solve the problems that the memory of some environments is limited, java or python dependent libraries cannot be installed, and interaction between the page and the local database needs to be realized, so that the establishment of the page and database communication link is simply and efficiently completed. In the invention, the page end is usually pc, a webpage can be opened to interact with the network server, and the webpage can be rendered into a display page according to data provided by the network server. Considering that the network server used needs to meet the requirement of small memory, it is preferable to use a thttpd server, which is developed based on C language, simple, small, portable, fast, and safe, and the executable file generated after compiling is only 170kB, and is suitable for deployment on a single board. And (3) carrying out first-step interaction with the page by using the thttpd server, and delivering the acquired data to a CGI program for processing. The CGI program firstly judges the request mode of the page and acquires corresponding parameters from different global variables according to different request modes. The request modes are generally divided into four types, search, add, delete and modify. Except that the search request mode is get, the other three request modes are post because the data of the database needs to be changed. The four data requests include the ID of the database to be searched and the identifier corresponding to each type, and the body field includes different data according to different request modes.
In an embodiment of the present invention, the obtaining request parameters from a global variable according to a request mode of the data request includes:
reading a type identifier contained in the data request;
determining a target request mode according to the type identifier;
decapsulating the QUERY _ STRING value and the parameters in the body field in the data request from the target request mode;
and packaging the unpacked parameters into a format supported by the database to obtain the request parameters.
Specifically, the CGI program can determine the request mode through the type identifier in the data request, for example, the type identifier is determined by means of a method ═ x, for example, when x is 1, the request mode is addition, when x is 2, the request mode is deletion, and the CGI program is made aware of the request mode of the data request by setting 4 different numbers. The data request may also include the ID of the target database, for example, a possible data request is http://192.168.10.135/cgi-bin/gnbtest. cgi? In the data request, tableID is an ID corresponding to the target database, and method 4 is used to indicate the request method. Then, since the data request is sent from the pc end through the web server, the data format is JSON format, however, the database does not support JSON format, and therefore, the format conversion is required. First, the data request in JSON data format is unpacked, and the useful values therein, i.e. the key parameters in the data request mentioned above, i.e. tableID, method, body field, etc., are read. And packaging the required data into a fixed format supported by the database, and sending the data to the OAM for processing.
In an embodiment of the present invention, the returning, by the database, data to the CGI program through the OAM terminal according to the request parameter includes:
the database calls an sql statement to read a QUERY _ STRING value and a body field in the request parameter;
judging whether the data can be successfully called or not according to the QUERY _ STRING value and the body field;
if the data can be successfully called, the called data and a successful identifier indicating that the execution result is successful are sent to the CGI program through the OAM end;
and if the data cannot be successfully called, sending a failure identifier representing that the execution result is failure and a code corresponding to the failure reason to the CGI program through the OAM terminal.
In conjunction with the request method described above, the data request interaction in the embodiment of the present invention is described in detail, and the content of the page request interaction is taken as an example of a data table.
Mode 1: when the request mode is search, the page uses get mode to request, and the carried QUERY _ STRING value is "tableID equals 1, and method equals 4". The body field may not be needed because the lookup is only a table of data that requests to display the request at the page side, and no changes are made to the data in the table. And then, calling the data table from the database with the tableID of 1 and rendering the data table to a page end.
Mode 2: when the request mode is an increase, the page uses a post mode to request, and the carried QUERY _ STRING value is "tableID ═ 1, and method ═ 1", because the request mode needs to add contents in the data table, the body field needs to carry the contents to be added, but because the contents are added, the original contents of the data table are not affected, and therefore the body field does not need to carry primary keys. And after the content is added, rendering the data table with the added content to a page end for displaying.
Mode 3: when the request mode is deletion, the page uses a post mode to request, the carried QUERY _ STRING value is 1, and the carried QUERY _ STRING value is 2, because the mode is to delete part of the content in the data table, the body field needs the primary key value of the information needing to be deleted, and after the deletion processing is completed according to the primary key value, the processed data table is rendered to the page end.
Mode 4: when the request mode is modification, the page uses a post mode to request, and the carried QUERY _ STRING value is "tableID ═ 1, and method ═ 3", in this mode, part of the content in the data table needs to be modified, so the body field needs to carry the information primary key value which needs to be modified and the specific content which needs to be modified.
In the modes 2, 3 and 4, since the original data table is changed, the specific content of the change needs to be indicated by the body field, and the request mode is post. In the mode 1, since only the content of a certain data table is viewed, the content in the data table does not change, so that the body field is not needed, and the request mode is get.
And the OAM end locally stores the received data and calls an interface of the database for processing. And calling the sql statement by the database to perform the operation required by the page, and returning a return value to the OAM end.
The invention utilizes a web server based on C language to develop encapsulation and decapsulation of json data by cgi, thereby realizing rapid interaction between a page and a local database, and a data interaction framework is shown in figure 2.
The PC terminal 201 can open a web page to interact with the web server 202, the web server 202 receives information to trigger the CGI program 203 to write the web page information into a database format and send the web page information to the OAM terminal 204 processing process, the OAM terminal 204 calls the database 205 to process interface price data and send the data to the database 205, and a data processing module of the database updates the database 205 to complete corresponding operations of page configuration.
In an embodiment of the present invention, the sending, by the CGI program, the returned data to the page side through the network server for rendering includes:
the CGI program packages the returned data into a JSON data format;
analyzing the returned data in the JSON data format to obtain form configuration information of a target form corresponding to the returned data, wherein the form configuration information represents the layout style and the data configuration information of the target form;
and rendering the form component of the target form from a component library according to the form configuration information, and rendering the target form at the page end.
JSON is called JavaScript Object Notation, namely the JS Object numbered Notation. It is a light-weight data exchange format with a compact and clear hierarchical structure. Because the form in the JSON data format is easier to read and write by people, is easy to analyze and generate by a machine, occupies less resources, not only can effectively improve the network transmission efficiency, but also can ensure the integrity and the accuracy of the form information.
As shown in fig. 3, an embodiment of the present invention provides an interaction server based on the data interaction method shown in fig. 1, including:
a network server 301, a CGI program 302, an OAM terminal 303, and a database 304;
the web server 301 is configured to receive a data request in a JSON data format sent by the page terminal; triggering a common gateway interface CGI program 302 when the data request is received;
the CGI program 302 is configured to obtain a request parameter from a global variable according to a request mode of the data request; processing the request parameter and sending the request parameter to an operation, maintenance and management (OAM) end 303;
the OAM terminal 303 is configured to invoke an interface of the database 304, and send the request parameter after format conversion to the database 304;
the database 304 is configured to return data to the CGI program 302 through the OAM terminal 303 according to the request parameter;
the CGI program 302 is further configured to send the returned data to the page side through the web server 301 for rendering.
In an embodiment of the present invention, when the network server 301 executes the request parameter obtained from the global variable according to the request mode of the data request, specifically:
reading a type identifier contained in the data request;
determining a target request mode according to the type identifier;
decapsulating the QUERY _ STRING value and the parameters in the body field in the data request from the target request mode;
and packaging the unpacked parameters into a format supported by the database 304 to obtain the request parameters.
In an embodiment of the present invention, when the CGI program 302 executes to send the returned data to the page side through the network server 301 for rendering, the following steps are specifically executed:
packaging the returned data into a JSON data format;
analyzing the returned data in the JSON data format to obtain form configuration information of a target form corresponding to the returned data, wherein the form configuration information represents the layout style and the data configuration information of the target form;
and rendering the form component of the target form from a component library according to the form configuration information, and rendering the target form at the page end.
It is to be understood that the illustrated structure of the embodiment of the present invention does not form a specific limitation to the interaction server. In other embodiments of the invention, the interaction server may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Since the above information interaction, execution process, and other contents between the units in the interaction server are based on the same concept as the method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
The present invention also provides a computer-readable medium storing instructions for causing a computer to perform a data interaction method as described herein. Specifically, a system or an apparatus equipped with a storage medium on which software program codes that realize the functions of any of the above-described embodiments are stored may be provided, and a computer (or a CPU or MPU) of the system or the apparatus is caused to read out and execute the program codes stored in the storage medium.
In this case, the program code itself read from the storage medium can realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
Examples of the storage medium for supplying the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD + RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer via a communications network.
Further, it should be clear that the functions of any one of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform a part or all of the actual operations based on instructions of the program code.
Further, it is to be understood that the program code read out from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion unit connected to the computer, and then causes a CPU or the like mounted on the expansion board or the expansion unit to perform part or all of the actual operations based on instructions of the program code, thereby realizing the functions of any of the above-described embodiments.
It should be noted that not all steps and modules in the above flows and system structure diagrams are necessary, and some steps or modules may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The system structure described in the above embodiments may be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by a plurality of physical entities, or some components in a plurality of independent devices may be implemented together.
In the above embodiments, the hardware unit may be implemented mechanically or electrically. For example, a hardware element may comprise permanently dedicated circuitry or logic (such as a dedicated processor, FPGA or ASIC) to perform the corresponding operations. The hardware elements may also comprise programmable logic or circuitry, such as a general purpose processor or other programmable processor, that may be temporarily configured by software to perform the corresponding operations. The specific implementation (mechanical, or dedicated permanent, or temporarily set) may be determined based on cost and time considerations.
While the invention has been shown and described in detail in the drawings and in the preferred embodiments, it is not intended to limit the invention to the embodiments disclosed, and it will be apparent to those skilled in the art that various combinations of the code auditing means in the various embodiments described above may be used to obtain further embodiments of the invention, which are also within the scope of the invention.

Claims (10)

1. The data interaction method is applied to an interaction server and is characterized by comprising the following steps:
receiving a data request in a JSON data format sent by a page end through a network server;
triggering a Common Gateway Interface (CGI) program when the network server receives the data request;
the CGI program acquires request parameters from a global variable according to the request mode of the data request, processes the request parameters and sends the request parameters to an operation, maintenance and management (OAM) end;
the OAM end calls an interface of the database and sends the request parameters after format conversion to the database;
the database returns data to the CGI program through the OAM end according to the request parameters;
and the CGI program sends the returned data to the page end through the network server for rendering.
2. The method of claim 1,
the type of the data request comprises any one of inquiry, addition, deletion and modification;
when the type of the data request is query, the request mode in the data request is get, and the data request carries the code number and the query type identifier of the target data to be queried;
when the type of the data request is increased, the request mode in the data request is post, the QUERY _ STRING value carried by the data request is the code number and the increased type identification of the target data serving as an increased target, and the body field comprises increased content;
when the type of the data request is deletion, the request mode in the data request is post, the QUERY _ STRING value carried by the data request is the code number and the deletion type identification of the target data serving as a deletion target, and the body field comprises the information primary key value needing to be deleted;
when the type of the data request is modification, the request mode in the data request is post, the QUERY _ STRING value carried by the data request is the code number and the modification type identification of the target data serving as a modification target, and the body field comprises the information primary key value needing to be modified and the corresponding modification parameter.
3. The method of claim 2,
the obtaining request parameters from the global variables according to the request mode of the data request includes:
reading a type identifier contained in the data request;
determining a target request mode according to the type identifier;
decapsulating the QUERY _ STRING value and the parameters in the body field in the data request from the target request mode;
and packaging the unpacked parameters into a format supported by the database to obtain the request parameters.
4. The method of claim 3,
the database returns data to the CGI program through the OAM terminal according to the request parameter, including:
the database calls an sql statement to read a QUERY _ STRING value and a body field in the request parameter;
judging whether the data can be successfully called or not according to the QUERY _ STRING value and the body field;
if the data can be successfully called, the called data and a successful identifier indicating that the execution result is successful are sent to the CGI program through the OAM end;
and if the data cannot be successfully called, sending a failure identifier representing that the execution result is failure and a code corresponding to the failure reason to the CGI program through the OAM terminal.
5. The method according to any one of claims 1 to 4,
the CGI program sends the returned data to the page side through the web server for rendering, including:
the CGI program packages the returned data into a JSON data format;
analyzing the returned data in the JSON data format to obtain form configuration information of a target form corresponding to the returned data, wherein the form configuration information represents the layout style and the data configuration information of the target form;
and rendering the form component of the target form from a component library according to the form configuration information, and rendering the target form at the page end.
6. Interaction server based on the data interaction method of any of claims 1 to 5, comprising:
the system comprises a network server, a CGI program, an OAM end and a database;
the network server is used for receiving a data request in a JSON data format sent by the page terminal; triggering a Common Gateway Interface (CGI) program when the data request is received;
the CGI program is used for acquiring request parameters from a global variable according to a request mode of the data request; processing the request parameter and sending the request parameter to an operation, maintenance and management (OAM) end;
the OAM end is used for calling an interface of the database and sending the request parameters after format conversion to the database;
the database is used for returning data to the CGI program through the OAM end according to the request parameters;
and the CGI program is also used for sending the returned data to the page end through the network server for rendering.
7. The server according to claim 6,
when executing the request parameter obtained from the global variable according to the request mode of the data request, the network server specifically executes:
reading a type identifier contained in the data request;
determining a target request mode according to the type identifier;
decapsulating the QUERY _ STRING value and the parameters in the body field in the data request from the target request mode;
and packaging the unpacked parameters into a format supported by the database to obtain the request parameters.
8. The server according to claim 7,
the CGI program, when executing sending the returned data to the page side through the web server for rendering, specifically executes:
packaging the returned data into a JSON data format;
analyzing the returned data in the JSON data format to obtain form configuration information of a target form corresponding to the returned data, wherein the form configuration information represents the layout style and the data configuration information of the target form;
and rendering the form component of the target form from a component library according to the form configuration information, and rendering the target form at the page end.
9. Data interaction apparatus, comprising: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor, configured to invoke the machine readable program, to perform the method of any of claims 1 to 5.
10. Computer readable medium, characterized in that it has stored thereon computer instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 5.
CN202011590506.4A 2020-12-29 2020-12-29 Data interaction method and device, computer readable medium and interaction server Pending CN112685667A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011590506.4A CN112685667A (en) 2020-12-29 2020-12-29 Data interaction method and device, computer readable medium and interaction server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011590506.4A CN112685667A (en) 2020-12-29 2020-12-29 Data interaction method and device, computer readable medium and interaction server

Publications (1)

Publication Number Publication Date
CN112685667A true CN112685667A (en) 2021-04-20

Family

ID=75455075

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011590506.4A Pending CN112685667A (en) 2020-12-29 2020-12-29 Data interaction method and device, computer readable medium and interaction server

Country Status (1)

Country Link
CN (1) CN112685667A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878460A (en) * 2017-03-24 2017-06-20 腾讯科技(深圳)有限公司 Communication processing method and device
CN110598135A (en) * 2018-05-24 2019-12-20 腾讯科技(深圳)有限公司 Network request processing method and device, computer readable medium and electronic equipment
WO2020013724A1 (en) * 2018-07-11 2020-01-16 Михаил Сергеевич ГЕРМАН Method of managing website data
CN111352682A (en) * 2018-12-24 2020-06-30 北京嘀嘀无限科技发展有限公司 Page rendering method, device, server and readable storage medium
CN111708600A (en) * 2020-08-20 2020-09-25 腾讯科技(深圳)有限公司 Page display method, device, equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878460A (en) * 2017-03-24 2017-06-20 腾讯科技(深圳)有限公司 Communication processing method and device
CN110598135A (en) * 2018-05-24 2019-12-20 腾讯科技(深圳)有限公司 Network request processing method and device, computer readable medium and electronic equipment
WO2020013724A1 (en) * 2018-07-11 2020-01-16 Михаил Сергеевич ГЕРМАН Method of managing website data
CN111352682A (en) * 2018-12-24 2020-06-30 北京嘀嘀无限科技发展有限公司 Page rendering method, device, server and readable storage medium
CN111708600A (en) * 2020-08-20 2020-09-25 腾讯科技(深圳)有限公司 Page display method, device, equipment and computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
傅?等: "基于BOA的异步环境参数监测及气象预报系统设计", 《现代信息科技》 *
梁永红等: "利用CGI建造Web数据库系统的中间件技术", 《现代计算机》 *

Similar Documents

Publication Publication Date Title
CN110198247B (en) Interface test method and system
CN107066631A (en) Display methods, device and the electronic equipment of the page
CN111343181B (en) Message processing method and system, data pool and computer readable storage medium
CN103942055A (en) Development system and method for fusion network mixing service process programming language
CN113419729B (en) Front-end page building method, device, equipment and storage medium based on componentization
CN114138372B (en) Front-end component loading method and device
CN113703785B (en) Component-based platform deployment method, device, equipment and storage medium
CN111934940B (en) Configurated service request method and device, electronic equipment and storage medium
CN113536185B (en) Application page loading method, storage medium and related equipment
CN113761412A (en) Application page display method and device, electronic equipment, medium and application system
CN111488286B (en) Method and device for independently developing Android modules
CN111209028B (en) Data processing method and device, electronic equipment and storage medium
CN111881043A (en) Page testing method and device, storage medium and processor
CN114124766B (en) Test method and device based on simulation data
CN112685667A (en) Data interaction method and device, computer readable medium and interaction server
CN107203389A (en) Control shows method and device
CN116185825A (en) Front-end self-test method, front-end device, and computer-readable storage medium
CN115186214A (en) Page configuration method and device, computer equipment and computer readable storage medium
CN115269228A (en) Data adaptive transmission method, device, equipment and medium
JP2002351781A (en) Content generating device using screen display page layout
CN114371982A (en) Simulation test method, device, equipment and readable storage medium
CN112597036A (en) Universal baffle testing method and device
CN113961279A (en) Page rendering method, device, server and storage medium
CN110417919A (en) A kind of flow abduction method and device
CN109165049A (en) Module data processing method and processing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210420

RJ01 Rejection of invention patent application after publication