Data access method based on dual network environment
By using non-blocking communication components and one-way transmission channels in a dual network environment, the problems of low data access efficiency and waste of storage space in a dual network environment are solved, and efficient and secure data access and storage are achieved.
Patent Information
- Application Number
- CN202011540852.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-23
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-12-23
Smart Images

Figure CN114661801B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a data access method based on a dual network environment. Background Art
[0002] With the development of information technology, various data access systems and their associated applications have been widely developed to facilitate people's lives and work. Generally speaking, users can access the system database of the data access system by operating the application, read the required data from the system database, or write data into the system database to achieve the operation purpose.
[0003] Generally speaking, a data access system includes a system server, a client connected to the system server, and a system database. In order to ensure the security of data in the system database and the convenience of accessing data, the system server includes an intranet server and an extranet server, and the system database includes an intranet database connected to the intranet server and an extranet database connected to the extranet server. That is, the intranet server and the intranet database are set up in the local area network, while the extranet server and the extranet database are set up outside the local area network. The intranet database is used to store intranet data involving sensitive information, and the extranet database is used to store extranet data that does not involve sensitive information, so as to ensure the security of sensitive information.
[0004] When the current application is accessed in a dual network environment, it needs to access the data of the system databases in the two network environments, and the process cannot guarantee its access efficiency; moreover, in the process of accessing the two system databases, the accessed data needs to be updated to the two system databases, so that the two system databases store double copies of the accessed data, and the data consistency in the two system databases cannot be guaranteed, and there is a large waste of storage space in the system databases. Summary of the invention
[0005] The present invention provides a data access method based on a dual network environment to solve the problems of low access efficiency and large waste of storage space in the data access process under the existing dual network environment.
[0006] The present invention provides a data access method based on a dual network environment, wherein the dual network environment includes a local server and a local database in a local network and an associated server and an associated database in an associated network; a first non-blocking communication component is arranged in the local server, and a second non-blocking communication component is arranged in the associated server, and a one-way request transmission channel and a one-way response transmission channel are created between the first non-blocking communication component and the second non-blocking communication component; the first non-blocking communication component includes a first buffer, and the first buffer is connected to the one-way request transmission channel and the one-way response transmission channel; the second non-blocking communication component includes a second buffer, and the second buffer is connected to the one-way request transmission channel and the one-way response transmission channel;
[0007] The data access method comprises:
[0008] The local server receives an access request sent by the client through the local network, accesses the local database based on the access request, and sends the access request to the associated server through the unidirectional request transmission channel if the local database does not contain original data corresponding to the access request;
[0009] The associated server receives the access request, accesses the associated database based on the access request, obtains the original data corresponding to the access request from the associated database, stores the original data in the second buffer, performs security verification on the original data, obtains response data that passes the verification, and sends the response data to the local server through the one-way response transmission channel;
[0010] The local server receives the response data, stores the response data in the first buffer, and forwards the response data stored in the first buffer to the client.
[0011] Preferably, after the local server receives an access request sent by the client through the local network and accesses the local database based on the access request, the data access method based on the dual network environment includes:
[0012] If the local database contains original data corresponding to the access request, the original data is obtained from the local database, a security check is performed on the original data, response data that passes the check is obtained, and the response data is forwarded to the client.
[0013] Preferably, the performing security verification on the original data and obtaining response data that passes the verification includes:
[0014] Identify the source identifier in the access request, obtain source information corresponding to the source identifier, perform source security verification on the original data based on the source information, and obtain a source verification result;
[0015] Acquire a data verification standard, use the data verification standard to perform data security verification on the original data, and obtain a data verification result;
[0016] If both the source verification result and the data verification result are verified to be passed, then the response data of the verified passing is obtained.
[0017] Preferably, before the local server receives the access request sent by the client through the local network, the data access method based on the dual network environment further includes:
[0018] The local server generates a channel creation request and sends the channel creation request to the associated server via the TCP communication protocol;
[0019] If the local server receives a creation response signal sent by the associated server within the channel creation time, the one-way request transmission channel and the one-way response transmission channel are successfully created, and the local server executes a timing detection mechanism;
[0020] If the local server does not receive the creation response signal sent by the associated server within the channel creation time, the creation of the one-way request transmission channel and the one-way response transmission channel fails, and the local server executes a repeated creation mechanism.
[0021] Preferably, the local server executes a timing detection mechanism, including:
[0022] The local server generates an operation response request at every preset detection time, and sends the operation response request to the associated server via the TCP communication protocol;
[0023] If the local server receives the operation response signal sent by the associated server within the operation response time, it is determined that the one-way request transmission channel and the one-way response transmission channel are operating normally;
[0024] If the local server does not receive the operation response signal sent by the associated server within the operation response time, it is determined that the one-way request transmission channel and the one-way response transmission channel are not operating normally, and the local server generates a channel creation request, and sends the channel creation request to the associated server through the TCP communication protocol.
[0025] Preferably, the local server executes a repeated creation mechanism, including:
[0026] The local server updates the number of connection failures;
[0027] If the number of connection failures reaches the failure threshold, the local server executes an error reminder mechanism;
[0028] If the number of connection failures does not reach the failure number threshold, the local server is executed to generate a channel creation request, and the channel creation request is sent to the associated server through the TCP communication protocol.
[0029] Preferably, after sending the access request to the associated server through the unidirectional request transmission channel, the data access method based on the dual network environment further includes:
[0030] When the local server has not received the response data after sending the request response time of the access request, generating a response query request;
[0031] The local server queries the shared memory based on the response query request to determine whether the shared memory stores a target response record corresponding to the access request;
[0032] If the shared memory stores the target response record, the local server executes a request loss protection mechanism;
[0033] If the shared memory does not store the target response record, the access request is sent to the associated server through the unidirectional request transmission channel.
[0034] Preferably, after sending the access request to the associated server through the unidirectional request transmission channel, the data access method based on the dual network environment further includes:
[0035] The local server forms current request information based on the request identifier and sending time of the access request, stores the current request information in the first buffer, obtains a timing detection time based on the sending time of the access request and the request response duration, and forms a timing detection task based on the timing detection time;
[0036] When the local server has not received the response data after sending the request response time of the access request, generating a response query request, including:
[0037] When the current system time reaches the timing detection time, the local server executes the timing detection task to detect whether the current request information in the first buffer stores response data corresponding to the access request. If the first buffer does not store response data corresponding to the access request, the response query request is generated.
[0038] Preferably, the local server executes a request loss protection mechanism, including:
[0039] The local server obtains a request execution time corresponding to the access request;
[0040] If the request execution time corresponding to the access request does not exceed the timeout threshold, executing sending the access request to the associated server through the unidirectional request transmission channel;
[0041] If the request execution time corresponding to the access request exceeds the timeout threshold, the local server executes an error reminder mechanism.
[0042] Preferably, the local server executes a request loss protection mechanism, including:
[0043] The local server obtains the number of request retransmissions corresponding to the access request;
[0044] If the number of request retransmissions corresponding to the access request does not exceed the retransmission number threshold, executing sending the access request to the associated server through the unidirectional request transmission channel;
[0045] If the number of request retransmissions corresponding to the access request exceeds the retransmission threshold, the local server executes an error reminder mechanism.
[0046] In the above-mentioned data access method based on the dual network environment, when the local database does not have the original data corresponding to the access request, the local server uses the first non-blocking communication component to send the access request through the one-way request transmission channel to realize non-blocking sending, which can improve the transmission efficiency of the access request in the process of multiple access requests, thereby improving the access response efficiency. The associated server obtains the original data from the associated database according to the access request, performs a security check on the original data, and obtains the response data that passes the security check to ensure the security of the response data. The associated server uses the second non-blocking communication component to send the response data through the one-way response transmission channel, which can realize non-blocking sending, and improve the transmission efficiency of the response data in the process of multiple access requests, thereby improving the access response efficiency. The first non-blocking communication component in the local server can store the response data received through the one-way response transmission channel in the first buffer, without storing it in the local database, saving the storage space of the local database, and effectively avoiding the waste of storage space caused by repeated storage of the response data by the system database. It can be understood that a one-way request transmission channel is used to send access requests, and a one-way response transmission channel is used to receive response data. Using two one-way transmission channels can realize one-way transmission of access requests and response data, avoid mutual interference in the access request and response data transmission processes, improve information transmission efficiency and ensure information transmission accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0048] Figure 1 is a schematic diagram of a data access system in one embodiment of the present invention;
[0049] Figure 2 is a flow chart of a data access method based on a dual network environment in one embodiment of the present invention;
[0050] Figure 3 is another flow chart of a data access method based on a dual network environment in one embodiment of the present invention;
[0051] Figure 4 is another flow chart of a data access method based on a dual network environment in one embodiment of the present invention;
[0052] Figure 5 is another flow chart of a data access method based on a dual network environment in one embodiment of the present invention;
[0053] Figure 6 is another flow chart of a data access method based on a dual network environment in one embodiment of the present invention;
[0054] Figure 7 is another flow chart of a data access method based on a dual network environment in one embodiment of the present invention;
[0055] Figure 8 is another flow chart of a data access method based on a dual network environment in one embodiment of the present invention;
[0056] Fig. 9 It is another flow chart of a data access method based on a dual network environment in one embodiment of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] The data access method based on the dual network environment provided by the embodiment of the present invention can be applied as follows: Figure 1 Specifically, the data access method based on the dual network environment is applied in a data access system, which includes a system server, a client connected to the system server, and a system database. In order to ensure the security and convenience of data access in the system database, the system server is divided into an intranet server and an extranet server, and the system database is divided into an intranet database connected to the intranet server and an extranet database connected to the extranet server.
[0059] In this example, the intranet server and the intranet database are set up in the local area network, that is, the intranet server and the intranet database communicate through the local area network; the extranet server and the extranet database are set up in the wide area network outside the local area network, that is, the extranet server and the extranet database communicate through the wide area network outside the local area network. The intranet database is used to store intranet data involving sensitive information, and the extranet database is used to store extranet data that does not involve sensitive information to ensure the security of sensitive information.
[0060] The client, also known as the user end, refers to an application that corresponds to the server and provides local services to customers. The client can be installed on, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Intranet servers and extranet servers can be implemented using independent servers or server clusters consisting of multiple servers.
[0061] In this example, the data access system may be a public security data access system, an industrial and commercial data access system, a bank data access system, or other data access systems applicable in a dual network environment.
[0062] In this embodiment, non-blocking communication components are provided on the intranet server and the extranet server, which can monitor access requests triggered by applications, access the intranet service library and / or the extranet database based on the access requests, obtain response data corresponding to the access requests, and feed back the response data to the client. During the transmission of access requests and response data, non-blocking transmission is adopted, that is, multiple data can be sent continuously without waiting for a response, which helps to improve the efficiency of information transmission between the client and the system server.
[0063] As an example, the non-blocking communication component may be a synchronous non-blocking communication component (hereinafter referred to as NIO communication component), and the NIO communication component performs data interaction based on Channel and Buffer, that is, data is always read from Channel to Buffer, or written from Buffer to Channel, and the NIO communication component also includes a Selector for monitoring events of multiple Channels. In this example, the NIO communication component can be used to implement synchronous non-blocking data interaction between the client and the system server.
[0064] As another example, the non-blocking communication component can be an asynchronous non-blocking communication component (hereinafter referred to as the AIO communication component). The AIO communication component requires a connection to register read and write events and callback methods. When performing read and write operations, you only need to directly call the read method or write method in the API. The read method and the write method are asynchronously processed. For read operations, the server will transfer the readable data stream into the Buffer corresponding to the read method and notify the application. For write operations, the system server will write the data stream passed by the write method and notify the application. In this example, the AIO communication component can be used to realize abnormal non-blocking data interaction between the client and the system server.
[0065] In one embodiment, if Figure 2As shown, a data access method based on a dual network environment is provided, wherein the dual network environment includes a local server and a local database in a local network, and an associated server and an associated database in an associated network; a first non-blocking communication component is provided in the local server, and a second non-blocking communication component is provided in the associated server, and a one-way request transmission channel and a one-way response transmission channel are created between the first non-blocking communication component and the second non-blocking communication component; the first non-blocking communication component includes a first buffer, and the first buffer is connected to the one-way request transmission channel and the one-way response transmission channel; the second non-blocking communication component includes a second buffer, and the second buffer is connected to the one-way request transmission channel and the one-way response transmission channel;
[0066] Data access methods include:
[0067] S21: The local server receives an access request sent by the client through the local network, accesses the local database based on the access request, and if the local database does not contain original data corresponding to the access request, sends the access request to the associated server through a unidirectional request transmission channel.
[0068] S22: The associated server receives the access request, accesses the associated database based on the access request, obtains original data corresponding to the access request from the associated database, stores the original data in a second buffer, performs a security check on the original data, obtains response data that passes the check, and sends the response data to the local server through a one-way response transmission channel.
[0069] S23: The local server receives the response data, stores the response data in a first buffer, and forwards the response data stored in the first buffer to the client.
[0070] The local network is a network where the local server and the local database are located. The associated network is a network where the associated server and the associated database are located. As an example, the local network and the associated network can be a local area network and a wide area network, respectively. For example, when the local network is a local area network, the associated network is a wide area network outside the local area network; for another example, when the associated network is a local area network, the local network is a wide area network outside the local area network.
[0071] Among them, the local server is a server that directly receives the access request triggered by the client, and the local server can be an intranet server or an extranet server. Understandably, when the access request triggered by the client is sent to the intranet server through the local area network, the intranet server receives the access request directly sent by the client, and at this time, the intranet server is a local server; when the access request triggered by the client is sent to the extranet server through the wide area network outside the local area network, the extranet server receives the access request directly sent by the client, and at this time, the extranet server is a local server.
[0072] Among them, the associated server is a server that is in a different network environment from the local server and can communicate with it. Generally speaking, the intranet server and the extranet server are local servers and associated servers to each other, that is, when the intranet server is a local server, the extranet server is an associated server; when the extranet server is a local server, the intranet server is an associated server.
[0073] Among them, the local database is a database connected to the local server. Generally speaking, when the intranet server is a local server, the intranet database connected to the intranet server is the local database; when the extranet server is a local server, the extranet database connected to the extranet server is the local database.
[0074] The associated database is a database connected to the associated server. Generally speaking, when the intranet server is the associated server, the intranet database connected to the intranet server is the associated database; when the extranet server is the associated server, the extranet database connected to the extranet server is the associated database.
[0075] Among them, the first non-blocking communication component is set in the local server, which can be a synchronous non-blocking communication component (hereinafter referred to as NIO communication component) or an asynchronous non-blocking communication component (hereinafter referred to as AIO communication component). A first buffer is set in the first non-blocking communication component, and the first buffer is a Buffer in the first non-blocking communication component.
[0076] The second non-blocking communication component is arranged in the associated server, and may be a synchronous non-blocking communication component (hereinafter referred to as NIO communication component) or an asynchronous non-blocking communication component (hereinafter referred to as AIO communication component). A second buffer is arranged in the second non-blocking communication component, and the second buffer is a buffer in the second non-blocking communication component.
[0077] Among them, the one-way request transmission channel is a transmission channel for sending access requests, specifically, a transmission channel for the first non-blocking communication component to send access requests to the second non-blocking communication component in a one-way manner. The one-way response transmission channel is a transmission channel for receiving response data, specifically, a transmission channel for the second non-blocking communication component to send response data to the first non-blocking communication component in a one-way manner. Figure 1 As shown, a sending channel 1A and a receiving channel 1B are set on the first non-blocking communication component, and a sending channel 2A and a receiving channel 2B are set on the second non-blocking communication component. Then, a one-way request transmission channel is constructed between the sending channel 1A and the receiving channel 2B, which is a transmission channel for sending access requests; a one-way response transmission channel is constructed between the sending channel 2A and the receiving channel 1B, which is a transmission channel for receiving response data.
[0078] In this example, the first buffer is connected to the one-way request transmission channel and the one-way response transmission channel, so that data in the first buffer can interact with the associated server through the one-way request transmission channel and the one-way response transmission channel.
[0079] In this example, the second buffer is connected to the one-way request transmission channel and the one-way response transmission channel, so that the data in the second buffer can interact with the local server through the one-way request transmission channel and the one-way response transmission channel.
[0080] The original data refers to the data directly obtained from the system database corresponding to the access request. That is, the original data can be the data directly obtained from the local database corresponding to the access request, or the data directly obtained from the associated database corresponding to the access request. The response data is the original data that has passed the security check.
[0081] As an example, in step S21, the first non-blocking communication component in the local server monitors port data in real time, and can receive access requests sent by clients in the same local network as the local server. After the first non-blocking communication component of the local server receives the access request sent by the client in the same local network, it is necessary to first query the local database connected to the local server based on the access request to determine whether the local database contains the original data corresponding to the access request. If the local database contains the original data corresponding to the access request, the original data is obtained from the local database, the original data is security-verified, the response data that passes the verification is obtained, and the response data is forwarded to the client to achieve a quick response to the client's access request. When the local database does not contain the original data corresponding to the access request, it is necessary to send an access request to the associated server through a one-way request transmission channel, and multiplex the one-way response transmission channel to receive the response data sent by the associated server, and then send the response data to the client. It can be understood that when the local database does not contain the original data corresponding to the access request, the first non-blocking communication component is used to send the access request through a unidirectional request transmission channel to achieve non-blocking sending, thereby improving the transmission efficiency of the access request during multiple access request access processes and thereby improving the access response efficiency.
[0082] As an example, in step S22, the second non-blocking communication component in the associated server monitors the port data in real time and receives the access request sent by the local server through the one-way request transmission channel; after the associated server receives the access request sent by the one-way request transmission channel, it can access the associated database based on the access request and obtain the original data corresponding to the access request from the associated database, and the original data refers to the data directly obtained from the associated database. Then, the original data is stored in the second buffer of the second non-blocking communication component, the original data is security-verified, and the response data that passes the verification is obtained to ensure the security of the response data. Finally, the second non-blocking communication component in the associated server sends the response data to the local server through the one-way response transmission channel, which can realize non-blocking transmission, improve the transmission efficiency of the response data in the access process of multiple access requests, and thus improve the access response efficiency.
[0083] As an example, in step S23, the first non-blocking communication component in the local server receives response data through a one-way response transmission channel, and can store the response data received through the one-way response transmission channel in a first buffer, and forward the response data in the first buffer to the client, so that the response data obtained from the associated server does not need to be stored in the local database, thereby saving storage space of the local database and effectively avoiding waste of storage space caused by repeated storage of response data in the system database.
[0084] In the data access method based on the dual network environment provided in this embodiment, when there is no original data corresponding to the access request in the local database, the local server uses the first non-blocking communication component to send the access request through the one-way request transmission channel to realize non-blocking sending, which can improve the transmission efficiency of the access request in the process of multiple access requests, thereby improving the access response efficiency. The associated server obtains the original data from the associated database according to the access request, performs a security check on the original data, and obtains the response data that passes the security check to ensure the security of the response data. The associated server uses the second non-blocking communication component to send the response data through the one-way response transmission channel, which can realize non-blocking sending, and improve the transmission efficiency of the response data in the process of multiple access requests, thereby improving the access response efficiency. The first non-blocking communication component in the local server can store the response data received through the one-way response transmission channel in the first buffer, without storing it in the local database, saving the storage space of the local database, and effectively avoiding the waste of storage space caused by repeated storage of the response data by the system database. It can be understood that a one-way request transmission channel is used to send access requests, and a one-way response transmission channel is used to receive response data. Using two one-way transmission channels can realize one-way transmission of access requests and response data, avoid mutual interference in the access request and response data transmission processes, improve information transmission efficiency and ensure information transmission accuracy.
[0085] As Figure 2 In a specific example shown, when the local server is an intranet server, the associated server is an extranet server, the local database is an intranet database, and the associated database is an extranet database, that is, when the local network is a local area network, and the associated network is a wide area network outside the local area network, Figure 2 The data access method based on the dual network environment shown specifically includes the following steps:
[0086] A21: The intranet server receives an access request sent by the client through the local area network, and accesses the intranet database based on the access request. If the intranet database does not contain original data corresponding to the access request, the first non-blocking communication component in the intranet server sends the access request to an external network server in the wide area network outside the local area network through a unidirectional request transmission channel.
[0087] A22: The second non-blocking communication component of the external network server receives the access request sent by the internal network server in the local area network through the one-way request transmission channel, accesses the external network database based on the access request, obtains the original data corresponding to the access request, stores the original data in the second buffer, performs a security check on the original data, obtains the response data that passes the check, and the second non-blocking communication component of the external network server sends the response data to the internal network server through the one-way response transmission channel.
[0088] A23: The intranet server receives the response data returned by the extranet server through the one-way response transmission channel, stores the response data in the first buffer of the first non-blocking communication component, and then forwards the response data in the first buffer to the client.
[0089] In this example, after the intranet server receives an access request sent by a client in the same LAN through the LAN, it first determines whether the intranet database contains the original data corresponding to the access request, that is, the data that the access request needs to access and obtain. If the intranet database contains the original data corresponding to the access request, the intranet server can directly obtain the original data corresponding to the access request from the intranet database, perform a security check on the original data, obtain the response data that passes the check, and send the response data directly to the client to achieve a quick response to the access request. If the intranet database contains the original data corresponding to the access request, the first non-blocking communication component set on the intranet server sends the access request to the external network server in a non-blocking manner through the one-way request transmission channel pre-created between the intranet server and the external network server. According to the received access request, the external network server obtains the original data corresponding to the access request from the external network database, performs security verification on the original data, and obtains the verified response data; then, the second non-blocking communication component set on the external network server sends the response data to the internal network server in a non-blocking manner through the one-way response transmission channel pre-created between the internal network server and the external network server, which not only ensures the security of the response data, but also ensures the response efficiency during the transmission of the response data, avoids the access request and the response data from interfering with each other, and affects the information transmission efficiency and the accuracy of the transmitted information. The first non-blocking communication component of the internal network server stores the response data transmitted by the one-way response transmission channel in the first buffer instead of in the internal network database, which can effectively save the storage space loss of the internal network database and avoid the repeated storage of the response data, resulting in the waste of storage space of the system database.
[0090] As Figure 2 In a specific example shown, when the local server is an external server, the associated server is an intranet server, the local database is an external database, and the associated database is an intranet database, that is, the local network is a wide area network outside the local area network, and the associated network is a local area network, Figure 2 The data access method based on the dual network environment shown specifically includes the following steps:
[0091] B21: the external network server receives an access request sent by the client through a wide area network outside the local area network, and accesses the external network database based on the access request. If the external network database does not contain original data corresponding to the access request, the first non-blocking communication component of the external network server sends the access request to the internal network server in the local area network through a unidirectional request transmission channel;
[0092] B22: The second non-blocking communication component of the intranet server receives an access request sent by an external server in a wide area network outside the local area network through a one-way request transmission channel, accesses the intranet database based on the access request, obtains original data corresponding to the access request, stores the original data in the second non-blocking communication component, performs a security check on the original data, and obtains response data that passes the check; the second non-blocking communication component in the intranet server sends the response data to the external server through the one-way response transmission channel.
[0093] B23: The first non-blocking communication component of the external network server receives the response data returned by the internal network server through the one-way response transmission channel, stores the response data in the first buffer of the first non-blocking communication component, and then forwards the response data in the first buffer to the client.
[0094] In this example, after the external network server receives the access request sent by the client in the same wide area network, it first determines whether the external network database contains the original data corresponding to the access request, that is, the data that the access request needs to access and obtain. If the external network database contains the original data corresponding to the access request, the external network server can directly obtain the original data corresponding to the access request from the external network database, perform a security check on the original data, obtain the response data that passes the check, and send the response data directly to the client to achieve a quick response to the access request. If the external network database does not contain the original data corresponding to the access request, the first non-blocking communication component set on the external network server sends the access request to the intranet server in a non-blocking manner through the one-way request transmission channel pre-created by the external network server and the intranet server. According to the received access request, the intranet server obtains the original data corresponding to the access request from the intranet database, stores the original data in the second buffer area, performs security verification on the original data, and obtains the response data that passes the verification; then, the response data is sent to the external network server in a non-blocking manner through the one-way response transmission channel pre-created by the external network server and the intranet server, which not only ensures the security of the response data, but also ensures the response efficiency during the transmission of the response data, avoids the access request and the response data from interfering with each other, and affects the information transmission efficiency and the accuracy of the transmitted information. The first non-blocking communication component of the external network server stores the response data transmitted by the one-way response transmission channel in the first buffer area instead of the external network database, which can effectively save the storage space loss of the external network database and avoid the repeated storage of the response data, resulting in the waste of storage space of the system database.
[0095] In one embodiment, if Figure 3 As shown, the original data is security verified and the response data that passes the verification is obtained, including:
[0096] S31: Identify the source identifier in the access request, obtain source information corresponding to the source identifier, perform source security verification on the original data based on the source information, and obtain the source verification result.
[0097] S32: Obtain a data verification standard, use the data verification standard to perform data security verification on the original data, and obtain a data verification result.
[0098] S33: If both the source verification result and the data verification result are verified to be passed, then the response data of the verification passing is obtained.
[0099] Among them, the source identifier is the sender identifier and the receiver identifier recorded in the access request. As an example, when the client sends an access request to the local server, the sender identifier in its access request is the user identifier of the client, that is, the user identifier corresponding to the user who triggered the access request; the receiver identifier is the local identifier corresponding to the local server. As another example, when the local server sends an access request to the associated server through a one-way request transmission channel, its sender identifier needs to be updated to the user identifier of the client and the local identifier corresponding to the local server, and its receiver identifier is updated to the associated identifier corresponding to the associated server. The user identifier here is an identifier used to uniquely identify a certain guest user, the local identifier is an identifier used to uniquely identify the local server, and the associated identifier is an identifier used to uniquely identify the associated server.
[0100] The source information corresponding to the source identifier is specific source information corresponding to the source identifier, including sender information corresponding to the sender identifier and receiver information corresponding to the receiver identifier.
[0101] As an example, in step S31, after receiving the access request, the system server (local server or associated server) needs to identify the two source identifiers, the sender identifier and the receiver identifier, in the access request; then, according to the two source identifiers, the sender information corresponding to the sender identifier and the receiver information corresponding to the receiver identifier are obtained respectively; the sender information is verified by using the sender verification standard to obtain the sender verification result to determine whether the sender information meets the security standard; the receiver information is verified by using the receiver verification standard to obtain the receiver verification result to determine whether the receiver information meets the security standard; if the sender verification result and the receiver verification result are both verified, the source verification result of the verification is obtained; if at least one of the sender verification result and the receiver verification result is verified and failed, the source verification result of the verification is obtained. It can be understood that the source security verification is performed on the source information corresponding to the source identifier in the access request to determine whether the sender information and the receiver information meet the corresponding security standards, which can ensure the security of the final response data to a certain extent.
[0102] The sender verification standard is a standard determined independently according to business needs for source security verification of sender information. The receiver verification standard is a standard determined independently according to business needs for source security verification of receiver information.
[0103] For example, when the original data is security-verified on the local server, the sender identifier is the user identifier and the receiver identifier is the local identifier. After the local server identifies the user identifier and the local identifier, it needs to obtain the user information corresponding to the user identifier and the local server information corresponding to the local identifier. Then the sender verification standard is used to verify the user information and obtain the sender verification result, for example, to verify whether the user corresponding to the user information is a legitimate user of the system, to verify whether the user corresponding to the user information has the authority to access the original data, to determine whether the original data meets the release standard. Next, the receiver verification standard is used to verify the local server information, for example, to verify whether the system ID or IP address corresponding to the local server information is currently in a secure state, to determine whether it meets the security standard. In this example, only when the sender verification result and the receiver verification result are both verified, the source verification result that passes the verification is obtained, which helps to ensure the effectiveness and comprehensiveness of the source verification result and improve the security of the response data. If at least one of the verification results of the sender and the verification results of the receiver fails the verification, the source verification result of the failed verification is obtained, and a response failure message of the failed verification can be generated, and the response failure message is sent to the client to respond to the access request, so as to avoid the user waiting for a long time and affecting the user experience.
[0104] For example, when the associated server performs security verification on the original data, its sender identifier is the user identifier and the local identifier, and the receiver identifier is the associated identifier. After the associated server identifies the user identifier, the local identifier and the associated identifier, it needs to obtain the user information corresponding to the user identifier and the local server information corresponding to the local identifier, determine it as the sender information, and obtain the associated server information corresponding to the associated identifier to determine it as the receiver information. Then, the sender verification standard is used to verify the local server information, and the sender verification result is obtained, for example, to verify whether the user corresponding to the user information is a legal user of the system, to verify whether the user corresponding to the user information has the authority to access the original data, and to verify whether the system ID or IP address corresponding to the local server information is currently in a safe state, so as to determine whether the original data meets the sender verification standard. Next, the receiver verification standard is used to verify the associated server information, for example, to verify whether the system ID or IP address corresponding to the associated server information is currently in a safe state, so as to determine whether it meets the receiver verification standard. In this example, only if the sender verification result and the receiver verification result are both verified, then the source verification result that passes the verification is obtained, which helps to ensure the effectiveness of the source verification result for security verification and improve the security of the response data. If at least one of the verification result of the sender and the verification result of the receiver fails the verification, the source verification result of the failed verification is obtained, a response failure message of the failed verification can be generated, and the response failure message is sent to the client.
[0105] Among them, the data verification standard is a standard set independently according to business needs for performing security verification on the original data itself.
[0106] As an example, in step S32, the system server (local server or associated server) can use at least one pre-set data verification standard to perform data security verification on the content of the original data, and obtain a single verification result corresponding to each data verification standard, which is the result of each data verification standard verifying the original data. If all single verification results are verified, the data verification results that pass the verification are obtained, that is, only when the single verification results corresponding to all data verification standards are verified, the data verification results that pass the verification are obtained, which helps to ensure the validity and comprehensiveness of the data verification results and improve the security of the response data; if there is at least one single verification result that fails the verification, the data verification result that fails the verification is obtained, and a response failure message of the verification failure can be formed, and the response failure message is sent to the client to achieve a response to the access request, avoiding the user waiting for a long time and affecting the user experience. For example, the data verification standard can be that when the original data is sensitive data, it is necessary to determine whether the release condition is met before it can be released; for another example, the data verification standard can be that when the original data is sensitive data, it is necessary to use a preset encryption algorithm to encrypt it before it can be released.
[0107] As an example, in step S33, if the source verification result and the data verification result are both verified, that is, the sender verification result and the receiver verification result are both verified, and all single verification results are verified. Then obtaining the verified response data will help ensure the comprehensiveness and effectiveness of the original data security verification, and thus ensure the security of the response data.
[0108] In one embodiment, if Figure 4 As shown, before step S21, that is, before the local server receives the access request sent by the client through the local network, the data access method based on the dual network environment also includes the following steps for the local server:
[0109] S41: The local server generates a channel creation request and sends the channel creation request to the associated server via the TCP communication protocol.
[0110] S42: If the local server receives a creation response signal sent by the associated server within the channel creation time, the one-way request transmission channel and the one-way response transmission channel are successfully created, and the local server executes a timing detection mechanism.
[0111] S43: If the local server does not receive a creation response signal sent by the associated server within the channel creation time, the creation of the one-way request transmission channel and the one-way response transmission channel fails, and the local server executes a repeated creation mechanism.
[0112] Among them, the channel creation request is a request for triggering the creation of a transmission channel between the local server and the associated server, specifically a request for creating two unidirectional transmission channels, a unidirectional request transmission channel and a unidirectional response transmission channel, between the local server and the associated server. The channel creation time is the pre-configured time required to wait for the creation of the transmission channel. The creation response signal refers to the signal formed by the associated server in response to the channel creation request sent by the local server. The TCP communication protocol is a connection-oriented, reliable, byte stream-based transport layer communication protocol that enables the local server and the associated server to create a long connection through a three-way handshake to transmit data. The repeated creation mechanism refers to the processing mechanism for repeated connection after the transmission channel creation fails.
[0113] As an example, in step S41, after the local server is powered on, it automatically generates a channel creation request according to a pre-configured connection request trigger program, and sends the channel creation request to the associated server based on the TCP communication protocol. The connection request trigger program is a pre-configured program for automatically triggering the generation of a channel creation request. The connection request trigger program can be a timing program, that is, it is triggered regularly after the local server is powered on. The channel creation request may include a creation identifier, a local identifier, and an association identifier. The creation identifier is a connection identifier used to reflect the need to create a transmission channel. The local identifier is a unique identifier of the local server. The association identifier is a unique identifier of the associated server.
[0114] In this example, after the local server is powered on, the local identifier corresponding to the local server that can create the transmission channel and the associated identifier corresponding to the associated server are first associated and stored in the memory of the local server and the associated server; when the local server is powered on, the program can be triggered according to the pre-configured connection request to process the local identifier and the associated identifier to form a channel creation request, and the channel creation request is transmitted to the associated server through the TCP communication protocol. After receiving the channel creation request sent by the local server, the associated server can detect whether the local identifier and the associated identifier in the channel creation request are consistent with those recorded in the memory; if they are consistent, a creation response signal is formed and sent to the local server; if they are inconsistent, the creation response signal is not sent to the local server, so as to achieve handshake using the channel creation request and the creation response signal to achieve the creation of the transmission channel.
[0115] Furthermore, in step S41, after the local server is powered on, it is necessary to first execute a self-test program to detect whether there is any abnormality in the local server. If there is no abnormality in the local server, it triggers the program according to the pre-configured connection request to automatically generate a channel creation request, and sends the channel creation request to the associated server based on the TCP communication protocol, thereby avoiding the inability to create a transmission channel due to an abnormality in the local server itself.
[0116] As an example, in step S42, within the channel creation time after the local server sends the channel creation request, the local server monitors in real time whether a creation response signal sent by the associated server is received. If the local server receives the creation response signal within the channel creation time, it is determined that the handshake between the local server and the associated server is successful, that is, the two unidirectional transmission channels, the unidirectional request transmission channel and the unidirectional response transmission channel between the local server and the associated server, are successfully created. The local server executes a timing detection mechanism to ensure the normal operation of the two unidirectional transmission channels and avoid abnormalities of the two unidirectional transmission channels, which may cause subsequent access requests and response data to fail to be transmitted smoothly.
[0117] As an example, in step S43, within the channel creation time after the local server sends the channel creation request, the local server monitors in real time whether a creation response signal sent by the associated server is received. If the local server does not receive the creation response signal within the channel creation time, it is determined that the handshake between the local server and the associated server is unsuccessful, that is, the creation of the two unidirectional transmission channels, the unidirectional request transmission channel and the unidirectional response transmission channel between the local server and the associated server, fails. At this time, it is necessary to execute a repeated creation mechanism to repeat the connection, so as to ensure that the two unidirectional transmission channels are successfully created or an error reminder is issued.
[0118] In one embodiment, if Figure 5 As shown, in step S42, the local server executes a timing detection mechanism, including:
[0119] S51: The local server generates an operation response request at every preset detection time, and sends the operation response request to the associated server via the TCP communication protocol.
[0120] S52: If the local server receives the operation response signal sent by the associated server within the operation response time, it is determined that the one-way request transmission channel and the one-way response transmission channel are operating normally.
[0121] S53: If the local server does not receive the operation response signal sent by the associated server within the operation response time, it is determined that the one-way request transmission channel and the one-way response transmission channel are not operating normally, and the local server generates a channel creation request and sends the channel creation request to the associated server through the TCP communication protocol.
[0122] The preset detection time is the interval time pre-set for detecting whether the two one-way transmission channels between the local server and the associated server are operating normally. The operation response request is a request for triggering the detection of whether the two one-way transmission channels between the local server and the associated server are operating normally. The operation response time is the response time pre-set for waiting to receive the operation response signal. The operation response signal refers to the response signal formed by the associated server in response to the operation response request triggered by the local server.
[0123] As an example, in step S51, the local server automatically generates an operation response request at every preset detection time according to a pre-configured detection request trigger program, and sends the operation response request to the associated server based on the TCP communication protocol. The detection request trigger program is a pre-set program that automatically triggers the generation of an operation response request. The detection request trigger program can be a timing program, that is, after the two unidirectional transmission channels between the local server and the associated server are successfully created, the operation response request can be automatically triggered at every preset detection time to detect whether the two unidirectional transmission channels between the local server and the associated server can operate normally. The operation response request includes a detection identifier, a local identifier, and an associated identifier. The detection identifier is an identifier used to reflect the function of detecting whether the transmission channel is operating normally.
[0124] As an example, in step S52, within the running response time after the local server sends the running response request, the local server detects in real time whether the running response signal sent by the associated server is received. If the local server receives the running response signal sent by the associated server within the running response time, it is determined that the handshake between the local server and the associated server is successful, that is, the two unidirectional transmission channels between the local server and the associated server are operating normally. Step S51 can be repeated, that is, an running response request is generated at every preset detection time, and the running response request is sent to the associated server through the TCP communication protocol to realize regular detection of whether the transmission channel is operating normally, which helps to ensure the normal transmission of access requests and response data and improve transmission efficiency.
[0125] As an example, in step S53, within the running response time after the local server sends the running response request, the local server detects in real time whether the running response signal sent by the associated server is received. If the local server does not receive the running response signal sent by the associated server within the running response time, it is determined that the handshake between the local server and the associated server has failed, that is, the two unidirectional transmission channels between the local server and the associated server are operating abnormally, which can be understood as the long connection between the two unidirectional transmission channels is disconnected. At this time, it is necessary to execute the local server to generate a channel creation request again, and send the channel creation request to the associated server through the TCP communication protocol, so as to realize timely repeated connection when the two unidirectional transmission channels are operating abnormally, so as to ensure the normal transmission of access requests and response data and improve transmission efficiency.
[0126] In one embodiment, if Figure 6 As shown, step S53, that is, the local server executes the repeated creation mechanism, includes:
[0127] S61: The local server updates the number of connection failures.
[0128] S62: If the number of connection failures reaches the failure threshold, the local server executes an error reminder mechanism.
[0129] S63: If the number of connection failures does not reach the failure number threshold, the local server is executed to generate a channel creation request, and the channel creation request is sent to the associated server through the TCP communication protocol.
[0130] The number of connection failures refers to the cumulative number of transmission channel creation failures determined after each triggering of a channel creation request. The failure number threshold refers to the number of failures allowed in advance, for example, the failure number threshold can be set to 3 times. The error reminder mechanism refers to a processing mechanism formed to remind the user after multiple consecutive transmission channel creation failures.
[0131] As an example, after the local server fails to create two one-way transmission channels between the local server and the associated server, the local server executes a repeated creation mechanism, that is, updates the number of connection failures, that is, adds 1 to the last number of connection failures to obtain the updated number of connection failures. Then, the updated number of connection failures is compared with the failure number threshold. If the number of connection failures reaches the failure number threshold, it is determined that the number of transmission channel creation failures is too many, and it is determined that the local server and / or the associated server is abnormal, resulting in the inability to create the transmission channel. At this time, the error reminder mechanism is executed to send an error reminder message to the system administrator terminal of the data access system so that the system administrator can perform maintenance and updates in time. If the number of connection failures does not reach the failure number threshold, it is determined that the number of transmission channel creation failures is small, and it does not meet the judgment standard for determining that the local server and / or the associated server is abnormal. It may be due to request loss or other problems that can be solved by re-triggering the channel creation request. At this time, the local server can be executed again to generate a channel creation request, and the channel creation request can be sent to the associated server through the TCP communication protocol to avoid directly triggering the error reminder mechanism, resulting in frequent triggering of error reminder information and poor user experience.
[0132] In one embodiment, if Figure 7 As shown, after step S21, after sending the access request to the associated server through the unidirectional request transmission channel, the data access method based on the dual network environment further includes:
[0133] S71: When the local server has not received any response data after sending the access request within the request response time, it generates a response query request.
[0134] S72: The local server queries the shared memory based on the response query request, and determines whether the shared memory stores a target response record corresponding to the access request.
[0135] S73: If the shared memory does not store the target response record, the local server executes the request loss protection mechanism.
[0136] S74: If the shared memory does not store the target response record, the access request is sent to the associated server through the one-way request transmission channel.
[0137] The request response duration is the preset duration required for a request and response. The response query request is a request for querying whether the response is successful. The shared memory is a preset memory for storing request response records, which is a memory shared by the local server and the associated server. The target response record is a request response record corresponding to the access request.
[0138] In this example, when the associated server receives an access request, it can obtain the request identifier and sending time corresponding to the access request. The request identifier is an identifier used to uniquely identify the access request, and the sending time is the time when the local server sends the access request to the associated server. After the associated server obtains the original data from the associated database, performs a security check on the original data, and obtains the response data that passes the check, it needs to generate a response identifier corresponding to the response data. The response identifier is an identifier used to uniquely identify the response data. Then, based on the request identifier and sending time corresponding to the access request and the response identifier corresponding to the response data, the associated server will form a request response record containing the request identifier, sending time and response identifier, and store the request response record in the shared memory, so that the local server can determine whether the response data is lost and take corresponding relief by accessing the request response record in the shared memory, which helps to ensure the effective transmission of the access request and response data.
[0139] Among them, the request loss protection mechanism refers to a processing mechanism for relief after the access request is lost. It can be understood that during the data transmission process of the one-way request transmission channel and the one-way response transmission channel, data loss caused by network jitter is inevitable. In order to overcome the data loss caused by network jitter and other reasons, the request loss protection mechanism is pre-configured for relief processing, so that the transmission process of access request and response data can effectively eliminate the interference of factors such as network jitter, and ensure the security of the access request and response data transmission process.
[0140] As an example, in steps S71-S72, the local server starts timing after sending the access request to the associated server in the associated network through the one-way request transmission channel, that is, starting from the time the access request is sent. If no response data is received after the time the access request is sent to the request response duration, a response query request will be triggered to query whether the shared memory stores a target response record corresponding to the access request, that is, whether there is a request response record containing a request identifier corresponding to the access request, so as to determine whether the associated server has sent the response data. Understandably, in
[0141] As an example, in step S73, when a target response record corresponding to an access request is stored in the shared memory, it is determined that the associated server has sent the response data to the local server through the one-way response transmission channel, but the local server has not received the response data, indicating that the response data is lost due to factors such as network jitter during transmission through the one-way response transmission channel. The request loss protection mechanism is executed for relief processing so that the transmission process of the access request and response data can effectively eliminate the interference of factors such as network jitter, so as to ensure the effective transmission of the response data and improve the security of the transmission process.
[0142] As an example, in step S74, when the target response record corresponding to the access request is not stored in the shared memory, it is determined that the associated server has not sent the response data to the local server through the one-way response transmission channel, that is, the local server sends an access request, but the associated server does not respond. It is possible that the access request is lost due to network jitter and other factors during transmission through the one-way request transmission channel, or it is possible that the response data is lost due to network jitter and other factors during transmission through the one-way response transmission channel. At this time, the local server directly executes the access request again to send the access request to the associated server through the one-way request transmission channel to eliminate the interference of network jitter of the one-way request transmission channel and / or the one-way response transmission channel, so as to ensure the effective transmission of the access request and response data and improve the security of the transmission process.
[0143] In one embodiment, after step S21, that is, after sending the access request to the associated server through the unidirectional request transmission channel, the data access method based on the dual network environment also includes: the local server forms current request information based on the request identifier and sending time of the access request, stores the current request information in a first buffer, obtains the timing detection time based on the sending time of the access request and the request response duration, and forms a timing detection task based on the timing detection time.
[0144] Accordingly, step S71, i.e., when the local server has not received any response data after sending the access request within the request response time, generates a response query request, including:
[0145] When the current system time reaches the timing detection time, the local server executes the timing detection task to detect whether the current request information in the first buffer stores response data corresponding to the access request. If the first buffer does not store response data corresponding to the access request, a response query request is generated.
[0146] As an example, after step S21, that is, after sending the access request to the associated server through the unidirectional request transmission channel, the local server will form a current request message based on the request identifier and the sending time of the access request, that is, each access request needs to form a current request message including the request identifier and the sending time after sending. Then, the local server will store the current request information in the first buffer, and the processing state corresponding to the current request information can be configured as a pending response state, so as to monitor the access request sent by the first non-blocking communication component based on the processing state, which helps to ensure the processing efficiency of the access request. In addition, the local server can also obtain the timing detection time based on the sending time of the access request and the request response time, and the timing detection time is the sending time of the access request plus the request response time. The timing detection task is a task used to detect whether the access request has a response, that is, whether the response data corresponding to the access request is detected. It can be understood that after sending the access request, the timing detection time is obtained based on the sending time of the access request and the request response duration. The timing detection time can be understood as the time to trigger the timing detection task, so as to detect whether the access request is responded successfully through the timing detection task. If the response is not successful, the corresponding relief is performed, including but not limited to the request loss protection mechanism.
[0147] In this example, the local server receives the response data and stores the response data in the first buffer. The processing status of the current request information corresponding to the response data recorded in the first buffer needs to be changed from the pending response status to the successful response status.
[0148] As an example, in step S71, when the local server detects that the current system time reaches the timing detection time corresponding to each current request information in the first buffer, it needs to perform a timing detection task to detect whether the current request information in the first buffer stores response data corresponding to the access request, that is, whether there is response data corresponding to the request identifier in the current request information; if response data corresponding to the access request is stored, the response is deemed to be successful, and there is no need to execute the loss protection mechanism for relief; if response data corresponding to the access request is not stored, the response is deemed to have failed, and a response query request is generated to query whether the shared memory contains the corresponding target response record according to the response query request, so as to determine whether to execute the request loss protection mechanism, and realize timely processing when the response data is not received, such as resending the access request or issuing an error reminder, so as to improve processing efficiency and help improve overall response efficiency.
[0149] In this example, the local server detects whether there is corresponding response data for the current request information in the first buffer. Specifically, the local server can detect the processing status corresponding to the current request information. If the processing status is a pending response status, it means that the local server has not received the corresponding response data. On the contrary, if the processing status is a successful response status, it means that the local server has received the corresponding response data. In this solution, the purpose of quickly detecting whether the response data has been received is achieved by flipping the status of the current request information.
[0150] In one embodiment, if Figure 8 As shown, in step S73, the local server executes the request loss protection mechanism, including the following steps:
[0151] S81: The local server obtains the request execution time corresponding to the access request.
[0152] S82: If the request execution time corresponding to the access request does not exceed the timeout threshold, the access request is sent to the associated server through the unidirectional request transmission channel.
[0153] S83: If the request execution time corresponding to the access request exceeds the timeout threshold, the local server executes an error reminder mechanism.
[0154] The request execution time refers to the time difference between the current system time and the time when the access request is sent. The timeout threshold is a pre-set time for evaluating whether a timeout has occurred. The error reminder mechanism refers to a processing mechanism formed after multiple consecutive transmission channel creation failures to remind the user.
[0155] As an example, when the local server has not received the response data after sending the request response time of the access request, and the shared memory stores the target response record, the system current time and the sending time of the access request are first executed to determine the request execution time of the access request. Then the request execution time is compared with the timeout threshold. If the request execution time does not exceed the timeout threshold, it is determined that there is no timeout. At this time, the access request can be sent to the associated server through the one-way request transmission channel, and the access request can be resent to overcome the problem of the inability to smoothly transmit the access request and the response data due to the occasional jitter of the transmission channel, so as to ensure the smooth progress of the data access process. If the request execution time corresponding to the access request exceeds the timeout threshold, it is determined that it has timed out. At this time, the error reminder mechanism can be executed to send an error reminder message to the system administrator terminal of the data access system so that the system administrator can perform maintenance and update in time. It can be understood that according to the comparison and judgment results of the request execution time and the timeout threshold, the access request and the error reminder message are resent respectively, which not only overcomes the situation that the response data cannot be transmitted due to the occasional jitter of the transmission channel, but also can realize the alarm in the case of timeout, so as to perform maintenance and update in time.
[0156] In one embodiment, if Fig. 9 As shown, in step S73, the local server executes the request loss protection mechanism, including the following steps:
[0157] S91: The local server obtains the number of request retransmissions corresponding to the access request.
[0158] S92: If the number of request retransmissions corresponding to the access request does not exceed the retransmission threshold, the access request is sent to the associated server through the unidirectional request transmission channel.
[0159] S93: If the number of request retransmissions corresponding to the access request exceeds the retransmission threshold, the local server executes an error reminder mechanism.
[0160] The request retransmission count refers to the number of times a certain access request is repeatedly sent before the current system time. The retransmission count threshold refers to the preset maximum number of times an access request can be repeatedly sent.
[0161] As an example, when the local server has not received the response data after sending the request response time of the access request, and the shared memory stores the target response record, the local server needs to query the access request sending log to determine the request retransmission times of the access request; then compare the request retransmission times with the retransmission times threshold; if the request retransmission times do not exceed the retransmission times threshold, it can be determined that the access request repeatedly sent before the current time of the system may still be due to the accidental jitter of the transmission channel and cannot be transmitted smoothly. Therefore, the access request can be sent to the associated server through the unidirectional request transmission channel again, and the access request can be resent to overcome the problem of the inability to smoothly transmit the access request and response data due to the accidental jitter of the transmission channel, so as to ensure the smooth progress of the data access process. If the request retransmission times corresponding to the access request exceed the retransmission times threshold, it can be determined that the access request repeatedly sent before the current time of the system is basically impossible to be due to the accidental jitter of the transmission channel. At this time, the error reminder mechanism can be executed to send error reminder information to the system administrator terminal of the data access system so that the system administrator can perform maintenance and updates in time. Understandably, based on the comparison and judgment results of the request retransmission times and the retransmission times threshold, the access request is retransmitted and the error reminder information is reported respectively, which not only overcomes the situation where the response data cannot be transmitted due to accidental jitter of the transmission channel, but also can realize the alarm when the request retransmission times exceeds the retransmission times threshold, so as to carry out maintenance and updates in time.
[0162] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0163] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0164] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A data access method based on a dual network environment, characterized in that: The dual network environment includes a local server and a local database in a local network and an associated server and an associated database in an associated network; a first non-blocking communication component is provided in the local server, and a second non-blocking communication component is provided in the associated server, and a one-way request transmission channel and a one-way response transmission channel are created between the first non-blocking communication component and the second non-blocking communication component; the first non-blocking communication component includes a first buffer, and the first buffer is connected to the one-way request transmission channel and the one-way response transmission channel; the second non-blocking communication component includes a second buffer, and the second buffer is connected to the one-way request transmission channel and the one-way response transmission channel; The data access method comprises: The local server receives an access request sent by the client through the local network, accesses the local database based on the access request, and sends the access request to the associated server through the unidirectional request transmission channel if the local database does not contain original data corresponding to the access request; The associated server receives the access request, accesses the associated database based on the access request, obtains the original data corresponding to the access request from the associated database, stores the original data in the second buffer, performs security verification on the original data, obtains response data that passes the verification, and sends the response data to the local server through the one-way response transmission channel; The local server receives the response data, stores the response data in the first buffer, and forwards the response data stored in the first buffer to the client.
2. The data access method based on a dual network environment as claimed in claim 1, characterized in that: After the local server receives an access request sent by the client through the local network and accesses the local database based on the access request, the data access method based on the dual network environment includes: If the local database contains original data corresponding to the access request, the original data is obtained from the local database, a security check is performed on the original data, response data that passes the check is obtained, and the response data is forwarded to the client.
3. The data access method based on a dual network environment as claimed in claim 1 or 2, characterized in that: The performing security verification on the original data and obtaining response data that passes the verification includes: Identify the source identifier in the access request, obtain source information corresponding to the source identifier, perform source security verification on the original data based on the source information, and obtain a source verification result; Acquire a data verification standard, use the data verification standard to perform data security verification on the original data, and obtain a data verification result; If both the source verification result and the data verification result are verified to be passed, then the response data of the verified passing is obtained.
4. The data access method based on a dual network environment as claimed in claim 1, characterized in that: Before the local server receives the access request sent by the client through the local network, the data access method based on the dual network environment further includes: The local server generates a channel creation request and sends the channel creation request to the associated server via the TCP communication protocol; If the local server receives a creation response signal sent by the associated server within the channel creation time, the one-way request transmission channel and the one-way response transmission channel are successfully created, and the local server executes a timing detection mechanism; If the local server does not receive the creation response signal sent by the associated server within the channel creation time, the creation of the one-way request transmission channel and the one-way response transmission channel fails, and the local server executes a repeated creation mechanism.
5. The data access method based on a dual network environment as claimed in claim 4, characterized in that: The local server executes a timing detection mechanism, including: The local server generates an operation response request at every preset detection time, and sends the operation response request to the associated server via the TCP communication protocol; If the local server receives the operation response signal sent by the associated server within the operation response time, it is determined that the one-way request transmission channel and the one-way response transmission channel are operating normally; If the local server does not receive the operation response signal sent by the associated server within the operation response time, it is determined that the one-way request transmission channel and the one-way response transmission channel are not operating normally, and the local server generates a channel creation request, and sends the channel creation request to the associated server through the TCP communication protocol.
6. The data access method based on a dual network environment as claimed in claim 4, characterized in that: The local server executes a repeated creation mechanism, including: The local server updates the number of connection failures; If the number of connection failures reaches the failure threshold, the local server executes an error reminder mechanism; If the number of connection failures does not reach the failure number threshold, the local server is executed to generate a channel creation request, and the channel creation request is sent to the associated server through the TCP communication protocol.
7. The data access method based on a dual network environment as claimed in claim 1, characterized in that: After sending the access request to the associated server through the unidirectional request transmission channel, the data access method based on the dual network environment further includes: When the local server has not received the response data after sending the request response time of the access request, generating a response query request; The local server queries the shared memory based on the response query request to determine whether the shared memory stores a target response record corresponding to the access request; If the shared memory stores the target response record, the local server executes a request loss protection mechanism; If the shared memory does not store the target response record, the access request is sent to the associated server through the unidirectional request transmission channel.
8. The data access method based on a dual network environment as claimed in claim 7, characterized in that: After sending the access request to the associated server through the unidirectional request transmission channel, the data access method based on the dual network environment further includes: The local server forms current request information based on the request identifier and sending time of the access request, stores the current request information in the first buffer, obtains a timing detection time based on the sending time of the access request and the request response duration, and forms a timing detection task based on the timing detection time; When the local server has not received the response data after sending the request response time of the access request, generating a response query request, including: When the current system time reaches the timing detection time, the local server executes the timing detection task to detect whether the current request information in the first buffer stores response data corresponding to the access request. If the first buffer does not store response data corresponding to the access request, the response query request is generated.
9. The data access method based on a dual network environment as claimed in claim 7, characterized in that: The local server executes a request loss protection mechanism, including: The local server obtains a request execution time corresponding to the access request; If the request execution time corresponding to the access request does not exceed the timeout threshold, executing sending the access request to the associated server through the unidirectional request transmission channel; If the request execution time corresponding to the access request exceeds the timeout threshold, the local server executes an error reminder mechanism.
10. The data access method based on a dual network environment as claimed in claim 7, characterized in that: The local server executes a request loss protection mechanism, including: The local server obtains the number of request retransmissions corresponding to the access request; If the number of request retransmissions corresponding to the access request does not exceed the retransmission number threshold, executing sending the access request to the associated server through the unidirectional request transmission channel; If the number of request retransmissions corresponding to the access request exceeds the retransmission threshold, the local server executes an error reminder mechanism.
Citation Information
Patent Citations
Network access system, network protective equipment and terminal server
CN104243442A
Transit method and device for network request
CN106993058A
External network middleware, internal network middleware and middleware system
CN204376941U
Network connection detection method, device, terminal, and computer storage medium
WO2019079950A1
