CN113704109B - Front-end and back-end data interaction method and device, electronic equipment and storage medium - Google Patents

Front-end and back-end data interaction method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113704109B
CN113704109B CN202111001097.4A CN202111001097A CN113704109B CN 113704109 B CN113704109 B CN 113704109B CN 202111001097 A CN202111001097 A CN 202111001097A CN 113704109 B CN113704109 B CN 113704109B
Authority
CN
China
Prior art keywords
data
end server
server
test case
thread
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.)
Active
Application number
CN202111001097.4A
Other languages
Chinese (zh)
Other versions
CN113704109A (en
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.)
Kangjian Information Technology Shenzhen Co Ltd
Original Assignee
Kangjian Information Technology Shenzhen 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 Kangjian Information Technology Shenzhen Co Ltd filed Critical Kangjian Information Technology Shenzhen Co Ltd
Priority to CN202111001097.4A priority Critical patent/CN113704109B/en
Publication of CN113704109A publication Critical patent/CN113704109A/en
Application granted granted Critical
Publication of CN113704109B publication Critical patent/CN113704109B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server

Abstract

The application relates to the field of data processing, and discloses a front-end and back-end data interaction method, which comprises the following steps: and determining a back-end server set by using a back-end address set, generating a server connection test case corresponding to the back-end server set, testing whether each back-end server in the front-end server set and each back-end server in the back-end server set is normally connected by using the server connection test case, acquiring request data required by the front-end server from the back-end server which is normally connected when the back-end server which is normally connected with the front-end server exists, aggregating each request data to obtain aggregated data, uniformly transmitting the aggregated data to the front-end server, and completing front-end and back-end data interaction. The application also discloses a front-end and back-end data interaction device, electronic equipment and a storage medium, and the application can solve the problems that a front-end server and a back-end server consume a large amount of communication resources when performing data interaction, and are easy to cause blocking and untimely in response.

Description

Front-end and back-end data interaction method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data processing, and in particular, to a front-end and back-end data interaction method, a device, an electronic apparatus, and a computer readable storage medium.
Background
The existing front-end server and the back-end server generally adopt a direct connection mode, namely the front-end server sends a plurality of data interaction request instructions to the back-end server, and the back-end server responds to each data interaction request instruction in turn and returns corresponding interaction data to the front-end server.
The direct connection data transmission mode can fulfill the aim of data interaction, but when a plurality of data interaction requests simultaneously request a back-end server, a large amount of communication resources are consumed from the response, index data, transmission data of the back-end server, the receiving and analyzing of a front-end server and the like, and phenomena such as data request blocking and untimely response are easily caused.
Disclosure of Invention
The application provides a front-end and back-end data interaction method, a device, electronic equipment and a computer readable storage medium, and mainly aims to solve the problems that a front-end server and a back-end server consume a large amount of communication resources when performing data interaction, and are easy to cause blocking and untimely in response.
In order to achieve the above object, the present application provides a front-end and back-end data interaction method, including:
receiving a plurality of data request instructions sent by a front-end server, and resolving a back-end address set from the plurality of data request instructions;
determining a back-end server set by using the back-end address set, generating a server connection test case corresponding to the back-end server set, and testing whether each back-end server in the front-end server set and each back-end server in the back-end server set is normally connected by using the server connection test case;
when the back-end server which is normally connected with the front-end server exists, acquiring request data required by the front-end server from the back-end server which is normally connected with the front-end server;
and aggregating each piece of request data to obtain aggregated data, and uniformly transmitting the aggregated data to the front-end server to finish front-end and back-end data interaction.
Optionally, the determining the backend server set by using the backend address set includes:
removing the back-end addresses with abnormal domain names from the back-end address set to obtain a back-end address set with normal domain names;
calling an information industry part record interface, and removing the rear-end addresses which are not recorded in the rear-end address set with normal domain names by using the information industry part record interface to obtain a recorded address set;
and determining the back-end server set according to the recorded address set.
Optionally, the generating a server connection test case corresponding to the backend server set includes:
receiving a test case script which is completed by pre-construction;
extracting a back-end server information function from the test case script;
sequentially taking each back-end address in the back-end address set as a parameter of the back-end server information function;
compiling the test case script comprising the entry to obtain the server connection test case.
Optionally, the testing whether the front-end server and each back-end server in the back-end server set are connected normally by using the server connection test case includes:
extracting a thread class to be inherited according to a written program of the server connection test case;
creating a thread subclass inheriting the class to be inherited of the thread;
receiving thread generation and starting functions written in the thread subclasses by a user;
the thread is utilized to generate and start a function to call the server connection test case;
and instantiating the thread subclass, calling the thread generating and starting function, and testing whether the front-end server is normally connected with each back-end server in the back-end server set.
Optionally, the acquiring the request data required by the front-end server from the back-end server that is normally connected includes:
extracting data to be encrypted according to a data request instruction corresponding to the back-end server which is normally connected;
acquiring the extraction time and the file size value of the data to be encrypted;
performing primary encryption on the extraction time and the file size value to obtain an encryption mark field;
and performing re-encryption on the data to be encrypted by using the encryption mark field to obtain the request data.
Optionally, the aggregating each piece of the request data to obtain aggregated data includes:
removing the request data which is null field from the request data to obtain non-null data;
generating a corresponding type storage table according to the data type of each piece of non-null data;
and sequentially storing the generated time and the data size of each piece of non-null data into the corresponding type storage table to obtain the aggregation data.
Optionally, the parsing the set of backend addresses of the data to be requested from the plurality of data request instructions includes:
extracting an instruction expression in each data request instruction;
removing meta characters, wildcards and escape characters in the instruction expression according to the construction rule of the instruction expression to obtain an address expression to be extracted;
and extracting the back-end address set from the address expression to be extracted.
In order to solve the above problems, the present application further provides a front-end and back-end data interaction device, which includes:
the address analysis module is used for receiving a plurality of data request instructions sent by the front-end server and analyzing a back-end address set from the plurality of data request instructions;
the connection test module is used for determining a back-end server set by utilizing the back-end address set, generating a server connection test case corresponding to the back-end server set, and testing whether the front-end server is normally connected with each back-end server in the back-end server set by utilizing the server connection test case;
the data request module is used for acquiring request data required by the front-end server from the back-end server which is normally connected when the back-end server which is normally connected with the front-end server exists;
and the data aggregation module is used for aggregating each piece of request data to obtain aggregated data, and uniformly transmitting the aggregated data to the front-end server to finish front-end and back-end data interaction.
In order to solve the above-mentioned problems, the present application also provides an electronic apparatus including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores a computer program executable by the at least one processor to implement the front-end and back-end data interaction methods described above.
In order to solve the above-mentioned problems, the present application also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the front-end and back-end data interaction method described above.
In the embodiment of the application, the back-end address set is firstly analyzed from a plurality of data request instructions, and compared with the prior art that the back-end address set is directly utilized to access the back-end server and request data, the embodiment of the application firstly generates the server connection test case according to the back-end address set, and eliminates the back-end server with failed connection by utilizing the server connection test case, thereby effectively preventing the phenomenon of communication resource waste caused by directly accessing the back-end server;
in addition, on the premise of ensuring that front and back end servers can be normally connected, request data required by the front end server are acquired from the back end servers which are normally connected, each piece of request data is aggregated to obtain aggregated data, and the aggregated data is uniformly transmitted to the front end server. Therefore, the front-end and back-end data interaction method, the front-end and back-end data interaction device, the electronic equipment and the computer readable storage medium can solve the problems that a large amount of communication resources are consumed by front-end and back-end servers for executing data interaction, and the problems of easy blocking and untimely response are caused.
Drawings
Fig. 1 is a flow chart of a front-end and back-end data interaction method according to an embodiment of the present application;
fig. 2 is a schematic flow chart of S2 in the front-end and back-end data interaction method according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of S3 in the front-end and back-end data interaction method according to an embodiment of the present application;
FIG. 4 is a schematic block diagram of a front-end and back-end data interaction device according to an embodiment of the present application;
fig. 5 is a schematic diagram of an internal structure of an electronic device for implementing a front-end and back-end data interaction method according to an embodiment of the present application;
the achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The embodiment of the application provides a product recommendation method based on user portraits. The execution subject of the product recommendation method based on the user portrait comprises at least one of a server, a terminal and the like which can be configured to execute the method provided by the embodiment of the application. In other words, the user portrayal-based product recommendation method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (ContentDelivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flow chart of a front-end and back-end data interaction method according to an embodiment of the application is shown. In the embodiment of the application, the front-end and back-end data interaction method comprises the following steps:
s1, receiving a plurality of data request instructions sent by a front-end server, and analyzing a rear-end address set of data to be requested from the data request instructions.
It should be explained that, the front-end server may support a web browser, a mobile phone APP, etc. operated by the user, and when the user uses a platform or software such as the web browser, the mobile phone APP, etc., the corresponding front-end server may generate a corresponding data request instruction according to the user requirement.
For example, a plurality of users of an enterprise may develop annual summary in advance, so that a data table design for executing annual summary by operating one data table operation page at the same time, it is conceivable that a plurality of data request instructions are generated in the data table operation page at the same time according to the requirements of different users. The data request instructions may include, among other things, annual expense request instructions, monthly revenue expense request instructions, invoice reimbursement request instructions, and the like for the business.
Further, the parsing the back end address set of the data to be requested from the plurality of data request instructions includes:
extracting an instruction expression in each data request instruction;
removing meta characters, wildcards and escape characters in the instruction expression according to the construction rule of the instruction expression to obtain an address expression to be extracted;
and extracting the back-end address set from the address expression to be extracted.
It should be appreciated that each data request instruction is made up of a plurality of instruction expressions, including HTTP protocol expressions, data transfer protocol expressions, front-end server information expressions, back-end server information expressions, and other conventional language programs, and the like.
In one embodiment of the application, in order to improve the resolution efficiency of the back-end address, the front-end server information expression and the back-end server information expression are directly extracted, and in order to prevent the interference of meta characters, wildcards and escape characters on the back-end address extraction, the meta characters, wildcards and escape characters are firstly directly removed, so that the problem of back-end address extraction errors is prevented.
In addition, based on the conventional writing mode of the address and combining a keyword matching method, the back-end address can be matched from the expression to be extracted of the address.
S2, determining a back-end server set by using the back-end address set, generating a server connection test case corresponding to the back-end server set, and testing whether the front-end server is normally connected with each back-end server in the back-end server set by using the server connection test case.
It should be appreciated that, because the front-end server and the back-end server generally need to determine the validity of the addresses of the respective servers before performing the data interaction, referring to fig. 2, the determining the back-end server set by using the back-end address set includes:
s21, removing the rear-end address with abnormal domain name from the rear-end address set to obtain a rear-end address set with normal domain name;
in the embodiment of the application, in order to prevent the phenomenon of abnormal access caused by the illegal user deliberately changing the back-end address, the back-end address with abnormal domain name is required to be removed first, and if the back-end address sets have the address set of the security access warning stored in the front-end server, the back-end address sets are removed correspondingly.
S22, calling a record interface of the information industry part, and removing the rear-end addresses which are not recorded in the rear-end address set with normal domain name by using the record interface of the information industry part to obtain a recorded address set;
it can be understood that legal websites all need to execute the recording operation in the information industry department, but abnormal or illegal websites cannot finish recording in the information industry department due to management violations and the like, so that the information industry department recording interface is called, and the recording condition of each rear-end address in the recording interface in the rear-end address set is sequentially queried, so that the safety is further improved.
S23, determining the back-end server set according to the recorded address set.
By combining the knowledge, when the abnormal domain name is removed and the record interface is queried, the illegal back-end address can be removed, so that the security of accessing the back-end server is improved.
Further, since the determined backend server sets are servers with higher security, the next step is to connect test cases with the servers, and test whether the front end server and each backend server can be connected correctly. It should be explained that, the test case is a test logic scheme constructed by a software developer based on the security, stability and compatibility of the system or the server by using a programming language, and in the embodiment of the application, the main function of the server connection test case is to test whether the front end server and the rear end server can be normally connected, so as to realize a theoretical basis for subsequent data interaction.
In detail, the generating a server connection test case corresponding to the backend server set includes:
receiving a test case script which is completed by pre-construction;
extracting a back-end server information function from the test case script;
sequentially taking each back-end address in the back-end address set as a parameter of the back-end server information function;
compiling the test case script comprising the entry to obtain the server connection test case.
It should be explained that the test case script is generally a test framework that has been built by a software developer based on a certain programming language, and in the test framework, only relevant necessary parameters, such as an address of a back-end server, an address of a front-end server, etc., need to be filled in, so that the testing of the front-end server and the back-end server can be performed.
It is conceivable that the test case script includes a back-end server information function and a front-end server information function, and that the front-end server is fixed, and that the corresponding software developer has written in advance the information such as the front-end server address, port number, etc. required by the front-end server information function.
Summarizing, when the back-end server information function is endowed with the parameters according to the back-end address set, the back-end server information function indicates that relevant necessary parameters are filled in the test case script, and then the server connection test case is compiled.
It is conceivable that one of the implementations of the present application requires a start-up thread to complete the test in order to increase the test speed, since connections to multiple backend servers need to be tested simultaneously. In detail, the testing whether the front-end server and each back-end server in the back-end server set are connected normally by using the server connection test case includes:
extracting a thread class to be inherited according to a written program of the server connection test case;
creating a thread subclass inheriting the class to be inherited of the thread;
receiving thread generation and starting functions written in the thread subclasses by a user;
the thread is utilized to generate and start a function to call the server connection test case;
and instantiating the thread subclass, calling the thread generating and starting function, and testing whether the front-end server is normally connected with each back-end server in the back-end server set.
Optionally, if the server connection test case is constructed by using a JAVA programming language, a thread class to be inherited exists in the JAVA programming language: thread class, further, using the extensions key of the JAVA programming language, creates a Thread subclass that inherits the Thread class, in the form of class Thread son extends Thread, where Thread son represents the Thread subclass.
For example, there is a thread generating and starting function in the line Cheng Zilei, which is mainly used for creating a thread for connecting with a server connection test case, and transmitting the server connection test case by using the thread, thereby completing connection test of front-end and back-end servers.
And S3, when the back-end server which is normally connected with the front-end server exists, acquiring request data required by the front-end server from the back-end server which is normally connected with the front-end server.
For example, when the plurality of users operate the data table operation page at the same time, a plurality of data request instructions may be generated, where different data request instructions may request different backend servers, so that data is requested from the backend servers with normal connection, and the backend server with failed connection is fed back to the developer to perform inspection and maintenance.
Further, referring to fig. 3, the obtaining, from the back-end server connected normally, request data required by the front-end server includes:
s31, extracting data to be encrypted according to a data request instruction corresponding to the back-end server which is normally connected;
s32, acquiring the extraction time and the file size value of the data to be encrypted;
s33, performing primary encryption on the extraction time and the file size value to obtain an encryption mark field;
s34, performing re-encryption on the data to be encrypted by using the encryption mark field to obtain the request data.
For example, when the plurality of users operate the data sheet operation page at the same time, the plurality of users respectively request to obtain the request data such as annual expense data, monthly income expense data, invoice reimbursement data and the like of the enterprise. The extraction time of the monthly income charge data from the back-end server is 2021, 08, 16 days, and the file size value is 50M, and then the encryption is performed on 2021, 08, 16 days, 50M by means of symmetric encryption, MD5 algorithm encryption, and the like, so as to obtain an encryption flag field 6631780.
Further, the encryption flag field 6631780 is embedded to the beginning of the monthly revenue expense data and re-encryption is performed to improve the data security of the monthly revenue expense data.
And S4, aggregating each piece of request data to obtain aggregated data, and uniformly transmitting the aggregated data to the front-end server to finish front-end and back-end data interaction.
It can be understood that, if the request data is sent immediately after the request data is obtained, when the request data is more, because the transmission times are too many, a larger transmission pressure may be caused to the front end server and the back end server, so the embodiment of the application firstly executes the aggregation operation on each request data to reduce the transmission times of the request data.
In detail, the aggregating each piece of the request data to obtain aggregated data includes:
removing the request data which is null field from the request data to obtain non-null data;
generating a corresponding type storage table according to the data type of each piece of non-null data;
and sequentially storing the generated time and the data size of each piece of non-null data into the corresponding type storage table to obtain the aggregation data.
In order to prevent the back-end server from returning null type request data, the preferred embodiment of the application firstly eliminates the request data of null field, thereby saving transmission resources.
When the multiple users operate the data table operation page, request data such as annual expense data, monthly income expense data, and enterprise gathering picture data are respectively obtained, wherein the annual expense data and the monthly income expense data belong to digital data, the enterprise gathering picture data belong to picture data, a digital type storage table and a picture type storage table are correspondingly generated, and the data are sequentially stored into the storage table according to the generation time and the data size of the table head and are uniformly transmitted to a front-end server for use by the front-end server, so that data interaction of the front-end server and the rear-end server is completed.
In the embodiment of the application, the back-end address set is firstly analyzed from a plurality of data request instructions, and compared with the prior art that the back-end address set is directly utilized to access the back-end server and request data, the embodiment of the application firstly generates the server connection test case according to the back-end address set, and eliminates the back-end server with failed connection by utilizing the server connection test case, thereby effectively preventing the phenomenon of communication resource waste caused by directly accessing the back-end server;
in addition, on the premise of ensuring that front and back end servers can be normally connected, request data required by the front end server are acquired from the back end servers which are normally connected, each piece of request data is aggregated to obtain aggregated data, and the aggregated data is uniformly transmitted to the front end server. Therefore, the front-end and back-end data interaction method, the front-end and back-end data interaction device, the electronic equipment and the computer readable storage medium can solve the problems that a large amount of communication resources are consumed by front-end and back-end servers for executing data interaction, and the problems of easy blocking and untimely response are caused.
Fig. 4 is a functional block diagram of the front-end and back-end data interaction device according to the present application.
The front-end and back-end data interaction device 100 of the present application may be installed in an electronic apparatus. The front-end and back-end data interaction device may include an address resolution module 101, a connection test module 102, a data request module 103, and a data aggregation module 104, depending on the implemented functions. The module of the present application may also be referred to as a unit, meaning a series of computer program segments capable of being executed by a processor of an electronic device and of performing a fixed function, stored in a memory of the electronic device.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the address resolution module 101 is configured to receive a plurality of data request instructions sent by a front-end server, and resolve a back-end address set from the plurality of data request instructions;
the connection test module 102 is configured to determine a back-end server set by using the back-end address set, generate a server connection test case corresponding to the back-end server set, and test whether each back-end server in the front-end server and the back-end server set is normally connected by using the server connection test case;
the data request module 103 is configured to obtain, when the back-end server that is normally connected to the front-end server exists, request data required by the front-end server from the back-end server that is normally connected to the front-end server;
the data aggregation module 104 is configured to aggregate each piece of the request data to obtain aggregated data, and uniformly send the aggregated data to the front-end server to complete front-end and back-end data interaction.
In detail, the modules in the front-end and back-end data interaction device 100 in the embodiment of the present application use the same technical means as the front-end and back-end data interaction method described in fig. 1, and can produce the same technical effects, which are not described herein.
Fig. 5 is a schematic structural diagram of an electronic device 1 implementing a front-end and back-end data interaction method according to the present application.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a front-end and back-end data interaction program, stored in the memory 11 and executable on the processor 10.
The processor 10 may be formed by an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed by a plurality of integrated circuits packaged with the same function or different functions, including one or more central processing units (Central Processing unit, CPU), a microprocessor, a digital processing chip, a graphics processor, a combination of various control chips, and so on. The processor 10 is a Control Unit (Control Unit) of the electronic device 1, connects respective components of the entire electronic device 1 using various interfaces and lines, executes programs or modules stored in the memory 11 (for example, executes front-end and back-end data interaction programs, etc.), and invokes data stored in the memory 11 to perform various functions of the electronic device 1 and process data.
The memory 11 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may in other embodiments also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as codes of front-end and back-end data interaction programs, but also for temporarily storing data that has been output or is to be output.
The communication bus 12 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
The communication interface 13 is used for communication between the electronic device 1 and other devices, including a network interface and a user interface. Optionally, the network interface may comprise a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device 1 and other electronic devices 1. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), or alternatively a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device 1 and for displaying a visual user interface.
Fig. 5 shows only an electronic device 1 with components, it being understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or may be arranged in different components.
For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for supplying power to each component, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The front-end and back-end data interaction program stored in the memory 11 of the electronic device 1 is a combination of a plurality of computer programs, which when run in the processor 10, can implement:
receiving a plurality of data request instructions sent by a front-end server, and resolving a back-end address set from the plurality of data request instructions;
determining a back-end server set by using the back-end address set, generating a server connection test case corresponding to the back-end server set, and testing whether each back-end server in the front-end server set and each back-end server in the back-end server set is normally connected by using the server connection test case;
when the back-end server which is normally connected with the front-end server exists, acquiring request data required by the front-end server from the back-end server which is normally connected with the front-end server;
and aggregating each piece of request data to obtain aggregated data, and uniformly transmitting the aggregated data to the front-end server to finish front-end and back-end data interaction.
In particular, the specific implementation method of the processor 10 on the computer program may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
Further, the integrated modules/units of the electronic device 1 may be stored in a non-volatile computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. The computer readable storage medium may be volatile or nonvolatile. For example, the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present application also provides a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device 1, may implement:
receiving a plurality of data request instructions sent by a front-end server, and resolving a back-end address set from the plurality of data request instructions;
determining a back-end server set by using the back-end address set, generating a server connection test case corresponding to the back-end server set, and testing whether each back-end server in the front-end server set and each back-end server in the back-end server set is normally connected by using the server connection test case;
when the back-end server which is normally connected with the front-end server exists, acquiring request data required by the front-end server from the back-end server which is normally connected with the front-end server;
and aggregating each piece of request data to obtain aggregated data, and uniformly transmitting the aggregated data to the front-end server to finish front-end and back-end data interaction.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module 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 can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present application and not for limiting the same, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present application without departing from the spirit and scope of the technical solution of the present application.

Claims (9)

1. A front-end and back-end data interaction method, the method comprising:
receiving a plurality of data request instructions sent by a front-end server, and resolving a back-end address set from the plurality of data request instructions;
determining a back-end server set by using the back-end address set, generating a server connection test case corresponding to the back-end server set, and testing whether each back-end server in the front-end server set and each back-end server in the back-end server set is normally connected by using the server connection test case;
when the back-end server which is normally connected with the front-end server exists, acquiring request data required by the front-end server from the back-end server which is normally connected with the front-end server;
aggregating each piece of request data to obtain aggregated data, and uniformly transmitting the aggregated data to the front-end server to complete front-end and back-end data interaction;
the method for testing whether the front-end server and each back-end server in the back-end server set are connected normally by using the server connection test case comprises the following steps: extracting a thread class to be inherited according to a written program of the server connection test case; creating a thread subclass inheriting the class to be inherited of the thread; receiving thread generation and starting functions written in the thread subclasses by a user; the thread is utilized to generate and start a function to call the server connection test case; and instantiating the thread subclass, calling the thread generating and starting function, and testing whether the front-end server is normally connected with each back-end server in the back-end server set.
2. The front-end and back-end data interaction method of claim 1, wherein said determining a set of back-end servers using said set of back-end addresses comprises:
removing the back-end addresses with abnormal domain names from the back-end address set to obtain a back-end address set with normal domain names;
calling an information industry part record interface, and removing the rear-end addresses which are not recorded in the rear-end address set with normal domain names by using the information industry part record interface to obtain a recorded address set;
and determining the back-end server set according to the recorded address set.
3. The front-end and back-end data interaction method of claim 1, wherein the generating server connection test cases corresponding to the back-end server set comprises:
receiving a test case script which is completed by pre-construction;
extracting a back-end server information function from the test case script;
sequentially taking each back-end address in the back-end address set as a parameter of the back-end server information function;
compiling the test case script comprising the entry to obtain the server connection test case.
4. The front-end and back-end data interaction method according to claim 1, wherein the obtaining the request data required by the front-end server from the back-end server that is normally connected comprises:
extracting data to be encrypted according to a data request instruction corresponding to the back-end server which is normally connected;
acquiring the extraction time and the file size value of the data to be encrypted;
performing primary encryption on the extraction time and the file size value to obtain an encryption mark field;
and performing re-encryption on the data to be encrypted by using the encryption mark field to obtain the request data.
5. The front-end and back-end data interaction method as set forth in claim 1, wherein said aggregating each of said request data to obtain aggregated data comprises:
removing the request data which is null field from the request data to obtain non-null data;
generating a corresponding type storage table according to the data type of each piece of non-null data;
and sequentially storing the generated time and the data size of each piece of non-null data into the corresponding type storage table to obtain the aggregation data.
6. The method for interacting front-end and back-end data according to claim 1, wherein said parsing the back-end address set from the plurality of data request instructions comprises:
extracting an instruction expression in each data request instruction;
removing meta characters, wildcards and escape characters in the instruction expression according to the construction rule of the instruction expression to obtain an address expression to be extracted;
and extracting the back-end address set from the address expression to be extracted.
7. A front-end and back-end data interaction device, the device comprising:
the address analysis module is used for receiving a plurality of data request instructions sent by the front-end server and analyzing a back-end address set from the plurality of data request instructions;
the connection test module is used for determining a back-end server set by utilizing the back-end address set, generating a server connection test case corresponding to the back-end server set, and testing whether the front-end server is normally connected with each back-end server in the back-end server set by utilizing the server connection test case;
the data request module is used for acquiring request data required by the front-end server from the back-end server which is normally connected when the back-end server which is normally connected with the front-end server exists;
the data aggregation module is used for aggregating each piece of request data to obtain aggregated data, and uniformly transmitting the aggregated data to the front-end server to complete front-end and back-end data interaction;
the method for testing whether the front-end server and each back-end server in the back-end server set are connected normally by using the server connection test case comprises the following steps: extracting a thread class to be inherited according to a written program of the server connection test case; creating a thread subclass inheriting the class to be inherited of the thread; receiving thread generation and starting functions written in the thread subclasses by a user; the thread is utilized to generate and start a function to call the server connection test case; and instantiating the thread subclass, calling the thread generating and starting function, and testing whether the front-end server is normally connected with each back-end server in the back-end server set.
8. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the front-end and back-end data interaction method of any one of claims 1 to 6.
9. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the front-end and back-end data interaction method according to any one of claims 1 to 6.
CN202111001097.4A 2021-08-30 2021-08-30 Front-end and back-end data interaction method and device, electronic equipment and storage medium Active CN113704109B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111001097.4A CN113704109B (en) 2021-08-30 2021-08-30 Front-end and back-end data interaction method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111001097.4A CN113704109B (en) 2021-08-30 2021-08-30 Front-end and back-end data interaction method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113704109A CN113704109A (en) 2021-11-26
CN113704109B true CN113704109B (en) 2023-10-20

Family

ID=78656488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111001097.4A Active CN113704109B (en) 2021-08-30 2021-08-30 Front-end and back-end data interaction method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113704109B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112653760A (en) * 2020-12-22 2021-04-13 平安银行股份有限公司 Cross-server file transmission method and device, electronic equipment and storage medium
CN113138929A (en) * 2021-05-12 2021-07-20 平安国际智慧城市科技股份有限公司 Distributed interface testing method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10372596B2 (en) * 2017-03-24 2019-08-06 International Business Machines Corporation Distributed system test device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112653760A (en) * 2020-12-22 2021-04-13 平安银行股份有限公司 Cross-server file transmission method and device, electronic equipment and storage medium
CN113138929A (en) * 2021-05-12 2021-07-20 平安国际智慧城市科技股份有限公司 Distributed interface testing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113704109A (en) 2021-11-26

Similar Documents

Publication Publication Date Title
CN113364753B (en) Anti-crawler method and device, electronic equipment and computer readable storage medium
CN113238929B (en) Code testing method and device based on Mock data, electronic equipment and storage medium
CN112506779A (en) Software interface testing method and device, electronic equipment and storage medium
WO2023029509A1 (en) Dynamic service publishing method and apparatus, and electronic device and storage medium
CN114398194A (en) Data collection method and device, electronic equipment and readable storage medium
CN114881616A (en) Business process execution method and device, electronic equipment and storage medium
CN112702228A (en) Service current limiting response method and device, electronic equipment and readable storage medium
CN113239106B (en) Excel file export method and device, electronic equipment and storage medium
CN114491646A (en) Data desensitization method and device, electronic equipment and storage medium
CN112486490B (en) Front-end code packaging method and device, electronic equipment and storage medium
CN114006885A (en) Data acquisition method and device based on intelligent equipment and electronic equipment
CN113468175A (en) Data compression method and device, electronic equipment and storage medium
CN113282854A (en) Data request response method and device, electronic equipment and storage medium
CN113032275A (en) Method and device for testing field, electronic equipment and storage medium
CN111783119A (en) Form data security control method and device, electronic equipment and storage medium
CN112580079A (en) Authority configuration method and device, electronic equipment and readable storage medium
CN113704109B (en) Front-end and back-end data interaction method and device, electronic equipment and storage medium
CN115544566A (en) Log desensitization method, device, equipment and storage medium
CN114978649A (en) Information security protection method, device, equipment and medium based on big data
CN112085611A (en) Asynchronous data verification method and device, electronic equipment and storage medium
CN112257078A (en) Block chain encryption and decryption service security trusted system based on TEE technology
CN113438221B (en) Local end file loading method and device, electronic equipment and medium
CN113703995B (en) Front-end and back-end data interaction method and device, electronic equipment and storage medium
CN113362040B (en) Approval chain configuration updating method and device, electronic equipment and storage medium
CN112637280B (en) Data transmission method, device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant