Data request method, system and storage medium

By establishing a socket link between the local server and the browser, the access address and data description information of the target restricted server are sent to the browser, which solves the problem of the local server being unable to access the target server in the microservice architecture and achieves The lightweight and efficient transmission of data requests ensures a smooth development process.

CN114401307BActive Publication Date: 2024-10-15PINGAN INT SMART CITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210059860.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2024-10-15
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

In a microservice architecture, the local server may not be able to access the target server, which limits the development process. Especially when the front-end and back-end of the microservice are maintained by different teams and use lightweight communication mechanisms, debugging and caching cannot be achieved. Data joint debugging.

Method used

By establishing a socket link between the local server and the browser, the access address and data description information of the target restricted server are sent to the browser. The browser generates a reference service request and obtains data from the target restricted server, and The data is sent back to the local server through the socket link, which solves the problem of limited access to the local server.

Benefits of technology

Without affecting the original business, it is possible to use the browser as a transfer station to solve the problem of local server access to restricted servers and ensure lightweight and efficient transmission of data requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114401307B_ABST
    Figure CN114401307B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a data request method, system and storage medium, which relate to the field of artificial intelligence technology, including: the local server obtains a target service request carrying a service identifier and target data description information, and when the local server does not have the target data corresponding to the target service request, the access address of the target restricted server is determined according to the service identifier, and the access address of the target restricted server and the target data description information are sent to the browser through a socket link, so as to obtain the target data corresponding to the target data description information from the target restricted server through the browser. The problem of limited access to the local server can be solved. The present application may involve blockchain technology, such as the target data can be written into the blockchain. The present application also relates to the field of digital medical technology, such as the target data includes data in the field of digital medical technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data request method, system and storage medium. Background Art

[0002] When the target server sets restricted access to the local server, the local server may not be able to access the target server, which may cut off the efficient development process. Therefore, how to solve the problem of restricted access to the local server is an important research topic. Summary of the invention

[0003] The embodiments of the present application provide a data request method, system and storage medium, which forward the service request of the local server to the browser through a socket link, so as to access the restricted server through the browser, thereby solving the problem of restricted access to the local server.

[0004] In a first aspect, an embodiment of the present application provides a data request method, the data request method comprising:

[0005] The local server obtains a target service request, which carries a service identifier and target data description information;

[0006] When the local server does not have the target data corresponding to the target service request, the local server determines the access address of the target restricted server according to the service identifier;

[0007] The local server sends the access address of the target restricted server and the target data description information to the browser through the socket link;

[0008] The browser generates a reference service request based on the access address of the target restricted server and the target data description information, and sends the reference service request to the target restricted server;

[0009] The browser obtains target data from the target restricted server and sends the target data to the local server through the socket link. The target data is data corresponding to the target data description information.

[0010] In a second aspect, an embodiment of the present application provides a data request system, the data request system comprising a local server and a browser, wherein:

[0011] The local server is used to obtain a target service request, which carries a service identifier and target data description information; when the local server does not have the target data corresponding to the target service request, the access address of the target restricted server is determined according to the service identifier, and the access address of the target restricted server and the target data description information are sent to the browser through the socket link;

[0012] The browser is used to generate a reference service request based on the access address of the target restricted server and the target data description information, and send the reference service request to the target restricted server; obtain the target data from the target restricted server, and send the target data to the local server through the socket link, and the target data is the data corresponding to the target data description information.

[0013] In a third aspect, an embodiment of the present application provides a data requesting device, the data requesting device comprising:

[0014] An acquisition unit, used to acquire a target service request, the target service request carrying a service identifier and target data description information;

[0015] A determination unit, configured to determine an access address of a target restricted server according to a service identifier when the data requesting device does not have target data corresponding to the target service request;

[0016] The sending unit is used to send the access address of the target restricted server and the target data description information to the browser through the socket link, so as to obtain the target data corresponding to the target data description information from the target restricted server through the browser.

[0017] In a fourth aspect, an embodiment of the present application further provides another data requesting device, the data requesting device comprising:

[0018] An acquisition unit, used to acquire the access address and target data description information of the target restricted server from the local server through the socket link;

[0019] A sending unit, configured to generate a reference service request based on an access address of a target restricted server and target data description information, and send the reference service request to the target restricted server;

[0020] The sending unit is also used to obtain target data from the target restricted server, and send the target data to the local server through the socket link, where the target data is data corresponding to the target data description information.

[0021] In a fifth aspect, an embodiment of the present application provides a data request device, the data request device comprising an input interface and an output interface, and the data request device further comprising:

[0022] a processor adapted to implement one or more instructions; and,

[0023] A computer storage medium storing one or more instructions suitable for loading and executing by a processor:

[0024] Obtain a target service request, which carries a service identifier and target data description information;

[0025] When the data requesting device does not have the target data corresponding to the target service request, determining the access address of the target restricted server according to the service identifier;

[0026] The access address of the target restricted server and the target data description information are sent to the browser through the socket link, so that the browser can obtain the target data corresponding to the target data description information from the target restricted server.

[0027] In a sixth aspect, an embodiment of the present application further provides another data request device, the data request device comprising an input interface and an output interface, and the data request device further comprising:

[0028] a processor adapted to implement one or more instructions; and,

[0029] A computer storage medium storing one or more instructions suitable for loading and executing by a processor:

[0030] Obtain the access address and target data description information of the target restricted server from the local server through the socket link;

[0031] Generate a reference service request based on the access address of the target restricted server and the target data description information, and send the reference service request to the target restricted server;

[0032] The target data from the target restricted server is obtained, and the target data is sent to the local server through the socket link, where the target data is data corresponding to the target data description information.

[0033] In a seventh aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer program instructions. When the computer program instructions are executed by a processor, they are used to execute the method described in the first aspect.

[0034] In an embodiment of the present application, when the local server does not have the target data corresponding to the target service request, the access address of the target restricted server can be determined according to the service identifier, and the access address of the target restricted server and the target data description information can be sent to the browser through the socket link, so that the browser can generate a reference service request based on the access address of the target restricted server and the target data description information, and obtain the target data corresponding to the target data description information from the target restricted server based on the reference service request. Since the browser can access the restricted server, the browser can be used as a transfer station between the local server and the restricted server, so as to solve the problem of limited access to the local server through the browser. In addition, the embodiment of the present application establishes a lightweight socket link between the local server and the browser, and the access address of the target restricted server and the target data description information are transferred in the socket link, which is different from the business data in the Restful interface between the local server and the browser, and is lightweight without affecting the original business. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 It is a schematic diagram of the architecture of a data request system provided in an embodiment of the present application;

[0037] Figure 2 It is a flowchart of a data request method provided in an embodiment of the present application;

[0038] Figure 3 is a structural diagram of a data request device provided in an embodiment of the present application;

[0039] Figure 4 is a structural diagram of another data request device provided in an embodiment of the present application;

[0040] Figure 5 is a structural diagram of a data request device provided in an embodiment of the present application;

[0041] Figure 6 It is a structural diagram of another data request device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0043] With the development of Internet technology, more and more microservice applications are appearing in daily life. At present, in the process of service division, a single application will be split into multiple small services with high cohesion and low coupling. Each small service runs independently. These small services are microservices. The front-end and back-end of microservices are developed and maintained by different teams. Lightweight communication mechanisms are used between services, which are independently and automatically deployed and can use different languages ​​and storage.

[0044] Since microservices are independent of each other, or the front-end and back-end of each microservice are also independent, for any local server in the microservice architecture (the local server includes the microservice, the front-end server in the microservice, or the back-end server in the microservice, etc.), the local server and other servers in the microservice architecture except the local server may be independent of each other, and the local server may not be able to access other servers in the microservice architecture except the local server, which will cut off the efficient development process. For example, when the front-end server in the microservice is deployed based on the webpack architecture, the front-end server in the microservice may not be able to access other servers in the microservice architecture, resulting in the inability to debug, let alone cache data for research and development before joint debugging.

[0045] After comparative research, it is found that the browser can access any server in the microservice architecture, and the local server can establish a data connection with the browser through a socket link. Based on this, the embodiment of the present application proposes a data request scheme, and the principle of the scheme is as follows: a socket link can be established between the browser and the local server. When the local server does not have the target data corresponding to the target service request, the access address of the target restricted server and the target data description information can be sent to the browser through the socket link, so that the browser can obtain the target data corresponding to the target data description information from the target restricted server, thereby solving the problem of limited access to the local server.

[0046] The data request scheme mentioned in the embodiment of the present application can be applied to Figure 1 In the data request system shown in FIG. Figure 1 As shown, the data request system may include at least a browser 11, a local server 12 and a plurality of restricted servers 13 (such as Figure 1The restricted server 13a or restricted server 13b shown in ). Wherein, the browser 11 and the local server 12 can exchange data through a Restful interface, and the browser 11 and the restricted server 13 can also exchange data through a Restful interface. Wherein, the browser 11 can be deployed in a terminal device on the user side, and the terminal device can include but is not limited to: a smart phone, a tablet computer, a laptop computer, a wearable device, a desktop computer, and the like. Wherein, the local server 12 can be deployed in a server, and the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, content delivery networks (Content Delivery Network, CDN), middleware services, domain name services, security services, and big data and artificial intelligence platforms, etc. Wherein, the restricted server is similar to the local server, and the restricted server can also be deployed in a server. The embodiments of the present application do not limit this.

[0047] For example Figure 1 In the data request system shown, the local server 12 can be used to obtain a target service request, which carries a service identifier and target data description information; when the local server 12 does not have the target data corresponding to the target service request, the local server 12 is used to determine the access address of the target restricted server according to the service identifier, and send the access address of the target restricted server and the target data description information to the browser 11 through a socket link. The browser 11 is used to generate a reference service request based on the access address of the target restricted server and the target data description information, and send the reference service request to the target restricted server; obtain the target data from the target restricted server, and send the target data to the local server 12 through a socket link, and the target data is the data corresponding to the target data description information. Among them, the target restricted server mentioned here can be Figure 1 Any restricted server among the multiple restricted servers 13.

[0048] Based on the above description, the data request method of the embodiment of the present application is described in detail below. Figure 2 As shown, Figure 2 A data request method is shown. Figure 2 As shown, the data request method includes S201-S207:

[0049] S201: The local server obtains a target service request, which carries a service identifier and target data description information.

[0050] Optionally, the local server may include one or more of a front-end server deployed based on a webpack architecture, a front-end server deployed based on a node architecture, and a back-end server deployed based on a Java architecture in a microservice architecture. This application does not limit this.

[0051] The service request is used to obtain the data indicated by the data description information. The service request may include a service identifier and data description information. The service identifier may be used to indicate the address at which the data is obtained, and the data description information may be used to indicate the characteristics of the data (e.g., request parameters of the data, etc.). Based on this, for a target service request, the target service request may include a service identifier and target data description information, the service identifier is used to indicate the address at which the target data is obtained, and the target data description information is used to indicate the characteristics of the target data.

[0052] Optionally, the target service request may be generated by a local server. Specifically, the local server may generate target data description information of the target data, call a script instruction to obtain the service identifier corresponding to the target data description information, and generate a target service request based on the target data description information and the service identifier. Optionally, the target service request may also be generated by a browser. Specifically, the browser may display a user interface, and obtain the target data description information and the service identifier of the target data in response to user operations in the user interface, and generate a target service request based on the target data description information and the service identifier. In this case, the browser may send the target service request to the local server through a Restful interface so that the local server can obtain the target service request.

[0053] S202: When the local server does not have the target data corresponding to the target service request, the local server determines the access address of the target restricted server according to the service identifier.

[0054] In one embodiment, the local server can search in the local database according to the target data description information in the target service request. When the local server can find the target data corresponding to the target data description information in the local database, the local server can directly use the target data as the response data of the target service request. When the local server fails to find the target data corresponding to the target data description information in the local database, the local server needs to obtain the target data from a restricted server other than the local server in the microservice architecture.

[0055] Optionally, a local server may correspond to multiple restricted servers. When the local server fails to find the target data corresponding to the target data description information, the access address of the target restricted server may be determined according to the service identifier carried in the target service request. Figure 1As shown, a local server may correspond to a restricted server 13a and a restricted server 13b. When the service identifier carried by the target service request indicates that the target restricted server is the restricted server 13a, the access address of the restricted server 13a may be determined as the access address of the target restricted server. When the service identifier carried by the target service request indicates that the target restricted server is the restricted server 13b, the access address of the restricted server 13b may be determined as the access address of the target restricted server.

[0056] The service identifier may be represented in a variety of ways, and may include one or more of numbers, letters, and characters. Optionally, the service identifier may be an independent identifier. Optionally, the service identifier may be related to the service request, for example, the service identifier is a suffix of the target service request. Optionally, the service identifier may also be related to the target description information, for example, the service identifier may be a fixed field in the target description information, and so on.

[0057] S203: The local server sends the access address of the target restricted server and the target data description information to the browser via the socket link.

[0058] In one embodiment, before the local server sends the access address of the target restricted server and the target data description information to the browser through the socket link, it is also necessary to establish a socket link, that is, to establish a socket link between the local server and the browser.

[0059] Among them, the socket link refers to a lightweight communication link that supports TCP / IP network communication. The communicating parties can use the relevant functions in the socket to complete the communication process. A first socket can be created on the local server side, and a second socket can be created on the browser side. The socket link between the first socket and the second socket is used as the socket link between the local server and the browser. Optionally, the local server can be used as the server of the socket link, and the browser can be used as the client of the socket link, that is, the first socket created on the local server side is a server socket (such as servesocket), and the second socket created on the browser side is a client socket (such as websocket).

[0060] Optionally, the process of establishing a socket link can be divided into three steps: server socket monitoring, client socket initiating a request, and socket link connection confirmation. Specifically, the local server can call the first socket to monitor the connection request from the second socket of the browser. When the local server calls the first socket to monitor the connection request from the second socket of the browser, the local server calls the first socket to send the characteristic information of the first socket to the second socket of the browser, so that the browser calls the second socket to establish a socket link with the first socket of the local server based on the characteristic information. In other words, the serve socket in the waiting state monitors the connection request of the websocket in real time. When the serve socket monitors the connection request of the websocket, it can respond to the connection request of the websocket and send the characteristic information of the serve socket to the websocket. When the websocket receives the description information of the serve socket, the socket connection is established.

[0061] In one embodiment, further, in order to avoid wasting resources, two states can be set for the socket link: an open state and a closed state. When the socket link is in the open state, the socket link consumes resources. When the socket link is in the closed state, the socket link does not consume and saves resources. Therefore, when data interaction through the socket link is not required, the socket link can be adjusted to the closed state to save resources. It should be noted that when the socket link is in the closed state, the socket link cannot support data interaction between the local server and the browser. When the socket link is in the open state, the socket link can support data interaction between the local server and the browser.

[0062] Based on the above description, in one embodiment, in order to save resources while ensuring the socket communication between the local server and the browser, after establishing the socket link and / or before sending the access address of the target restricted server and the target data description information to the browser through the socket link, the local server can obtain the current state of the socket link, and when the current state of the socket link is the open state, the step of sending the access address of the target restricted server and the target data description information to the browser through the socket link is triggered. When the current state of the socket link is the closed state, the step of sending the access address of the target restricted server and the target data description information to the browser through the socket link cannot be executed.

[0063] Optionally, the flag bit can be used to indicate the current state of the socket link. Optionally, the flag bit can be a field. For example, when the flag bit is the first field, the local server determines that the current state of the socket link is an open state, and when the flag bit is the second field, the local server determines that the current state of the socket link is a closed state. Among them, the first field and the second field mentioned above refer to different fields. For example, the first field can be "true" and the second field can be "false"; or, the first field can be "false" and the second field can be "true".

[0064] Optionally, the identification bit can also be a bit. For example, when the identification bit is the first bit value, the local server determines that the current state of the socket link is the open state, and when the identification bit is the second bit value, the local server determines that the current state of the socket link is the closed state. Among them, the first bit value and the second bit value mentioned above refer to different bit values. For example, the first bit value can be "0" and the second bit value can be "1"; or, the first bit value can be "1" and the second bit value can be "0", and so on.

[0065] S204: The browser generates a reference service request based on the access address of the target restricted server and the target data description information.

[0066] In one embodiment, in order to save resources, the browser can integrate the data description information accessing the same restricted server, so as to obtain data corresponding to multiple data description information at the same time through a reference service request. In a specific implementation, a corresponding queue can be set for each restricted server. The data description information in the corresponding queue of each restricted server is set to generate a reference service request according to the period and the access address of the restricted server. Therefore, when the browser obtains the access address of the target restricted server and the target data description information, the target data description information can be written into the target queue corresponding to the target restricted server based on the access address of the target restricted server. When the target period is reached, at least one data description information including the target data description information is taken out from the target queue, and a reference service request is generated based on the at least one data description information and the access address of the target restricted server.

[0067] Among them, the queue mentioned above can be a queue composed of data description information, and the data description information in the queue is taken out from the queue according to a preset period. Optionally, the period of the queue corresponding to each restricted server may be different. Optionally, the number of data description information taken out each time may be all the data description information included in the queue. Optionally, the number of data description information taken out each time is a preset number M, where M is a positive integer. M can be a fixed number or data associated with a target period. For example, M is negatively correlated with the period. Among them, the period corresponding to each queue can be preset, and can be set specifically according to business needs and experience.

[0068] In one embodiment, in order to avoid congestion, the queue of the restricted server can also be set to a fixed length (i.e., the maximum number of data description information included in the queue is set). Then, before writing the target data description information into the target queue corresponding to the target restricted server based on the access address of the target restricted server, it is also necessary to determine whether the number of data description information in the target queue corresponding to the target restricted server is greater than the first threshold. Specifically, the number of data description information in the target queue can be obtained, and when the number of data description information included in the target queue is greater than the first threshold, the target data description information request is discarded, or the target data description information is written into the alternative queue of the target restricted server, wherein the data description information included in the alternative queue of the target restricted server is set to be written back to the target queue when the number of data description information included in the target queue is less than the first threshold.

[0069] Optionally, the maximum number of data description information set in the target queue, that is, the first threshold is fixed. When the first threshold is exceeded, subsequent data description information can no longer be written into the target queue, thereby avoiding congestion. Before the data description information is taken out from the target queue at a regular interval and in a fixed quantity, the data description information in the target queue is controlled, thereby reducing the pressure on the target queue.

[0070] Optionally, when the number of requests in the target queue is greater than the first threshold, the target data description information can be processed in two ways, one is to directly discard it, and the other is to write it into the alternative queue of the target restricted server. Among them, the alternative queue of the target restricted server can also be set with a maximum number. When the alternative queue of the target restricted server is also full, the subsequent data description information is directly discarded. For example, the first threshold of the target queue of the target restricted server can be 100. When the target queue of the target restricted server is full of 100 data description information, the 101st data description information can be directly discarded or written into the alternative queue of the target restricted server. Further, the predetermined threshold of the alternative queue of the target restricted server can also be set to 100. When the alternative queue of the target restricted server is also full of data description information, the 201st data description information is also discarded. It should be noted that the predetermined threshold of the alternative queue of the target restricted server can be the same as or different from the first threshold of the target queue of the target restricted server.

[0071] Optionally, when the target queue of the target restricted server is operating normally, the alternative queue of the target restricted server exists as a standby queue. When the amount of data description information in the target queue of the target restricted server is less than a first threshold), part of the data description information in the alternative queue of the target restricted server can be written back to the target queue of the target restricted server. Furthermore, when the amount of data description information in the target queue of the target restricted server is less than a second threshold (e.g., 50), part of the data description information in the alternative queue of the target restricted server can be written back to the target queue of the target restricted server.

[0072] Optionally, when a target queue of the target restricted server fails, data description information in the target queue of the target restricted server may be written into a standby queue of the target restricted server, thereby avoiding data loss.

[0073] S205: The browser sends the reference service request to the target restricted server.

[0074] Specifically, since the browser and the target restricted server can exchange data through a RESTful interface, the reference service request can be sent to the target restricted server through the RESTful interface.

[0075] The reference service request may be a service request that supports the interaction between the browser and the restricted server, such as an Ajax request. Ajax stands for Asynchronous Javascript And XML, which refers to a web development technology for creating interactive web applications.

[0076] S206: The target restricted server returns target data, where the target data is data corresponding to the target data description information.

[0077] In one embodiment, when the target restricted server obtains the target data description information in response to the reference service request, the target restricted server can search for the corresponding target data in the target database according to the target data description information, and return the target data to the browser, so that the browser can obtain the target data from the target restricted server. It should be noted that if the reference service request includes at least one data description information including the target data description information, the target restricted server can search for the data corresponding to each data description information in the target database according to each data description information, and return the data corresponding to each data description information to the browser, which is not elaborated in this application.

[0078] In one embodiment, in order to ensure security, when the browser obtains the target data from the target restricted server, the browser can also perform anomaly detection on the target data from the target restricted server. When the detection result of the target data is normal, the target data can be forwarded to the local server through the socket link. When the detection result of the target data is abnormal, the browser can intercept the target data and generate an alarm message, and forward the alarm message to the local server. Among them, the anomaly detection includes but is not limited to determining whether the data is garbled or whether the data is repeated multiple times, etc.

[0079] Optionally, the target data may be medical data, such as personal health records, prescriptions, examination reports, and the like.

[0080] S207: The browser sends the target data to the local server through the socket link.

[0081] The browser sends the target data to the local server through the socket link, and uses the target data as the response data of the target service request. Furthermore, in order to ensure the integrity of data transmission, when the target service request is generated by the browser, the local server also needs to send the target data to the browser. The local server can send the target data to the browser through a Restful interface.

[0082] In one embodiment, the local server receives the target data from the browser. In order to avoid data loss, the target data can also be written into the blockchain (Block Chain), so that the target data corresponding to the target description information can be directly called later. Specifically, the target data can be verified. If the verification passes, the consensus node in the blockchain network will perform consensus verification on the target data; if the consensus verification passes, the target data will be encapsulated into a block and the block will be written into the blockchain.

[0083] Among them, blockchain is a distributed ledger that combines data blocks in a sequential manner in chronological order to form a chain data structure, and uses cryptography to ensure that the data cannot be tampered with or forged. Multiple independent distributed nodes save the same records. Blockchain technology has achieved decentralization and has become the cornerstone of trusted digital asset storage, transfer and trading.

[0084] In an embodiment of the present application, when the local server does not have the target data corresponding to the target service request, the access address of the target restricted server can be determined according to the service identifier, and the access address of the target restricted server and the target data description information can be sent to the browser through the socket link, so that the browser can generate a reference service request based on the access address of the target restricted server and the target data description information, and obtain the target data corresponding to the target data description information from the target restricted server based on the reference service request. Since the browser can access the restricted server, the browser can be used as a transfer station between the local server and the restricted server, so as to solve the problem of limited access to the local server through the browser. In addition, the embodiment of the present application establishes a lightweight socket link between the local server and the browser, and the access address of the target restricted server and the target data description information are transferred in the socket link, which is different from the business data in the Restful interface between the local server and the browser, and is lightweight without affecting the original business.

[0085] See also Figure 3 , Figure 3 A schematic diagram of a data request device provided in an embodiment of the present application. The data request device may be the local server mentioned in the above method embodiment, and may include an acquisition unit 301, a determination unit 302, and a sending unit 303.

[0086] An acquisition unit 301 is used to acquire a target service request, where the target service request carries a service identifier and target data description information;

[0087] A determination unit 302, configured to determine an access address of a target restricted server according to a service identifier when the data requesting device does not have target data corresponding to the target service request;

[0088] The sending unit 303 is used to send the access address of the target restricted server and the target data description information to the browser through the socket link, so that the browser can obtain the target data corresponding to the target data description information from the target restricted server.

[0089] In some feasible implementation manners, before the sending unit 303 is used to send the access address of the target restricted server and the target data description information to the browser through the socket link, the sending unit 303 is also used to:

[0090] Call the first socket to listen for the connection request from the second socket of the browser;

[0091] When the first socket monitors the connection request of the second socket, the first socket is called to send the characteristic information of the first socket to the second socket of the browser, so that the browser calls the second socket to establish a socket link with the first socket of the data requesting device based on the characteristic information.

[0092] In some feasible implementations, the sending unit 303 is used to call the first socket to send the characteristic information of the first socket to the second socket of the browser, so that after the browser calls the second socket to establish a socket link with the first socket of the data requesting device based on the characteristic information, the sending unit 303 is also used to:

[0093] Get the current status of the socket link;

[0094] When the current state of the socket link is an open state, the step of sending the access address of the target restricted server and the target data description information to the browser through the socket link is triggered.

[0095] According to another embodiment of the present application, Figure 3 The various units in the data request device shown can be separately or all combined into one or several other units to constitute, or one (some) of the units can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, other units can also be included based on the data request device. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0096] According to another embodiment of the present application, the system can include a central processing unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and other processing elements and storage elements. For example, a general computing device such as a computer can execute the following operations: Figure 2A computer program (including program code) for each step involved in the corresponding method shown in Figure 3 The data request device shown in the figure is used to implement the data request method of the embodiment of the present application. The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the above-mentioned local server through the computer-readable recording medium and run therein.

[0097] In an embodiment of the present application, when the data request device does not have the target data corresponding to the target service request, the access address of the target restricted server can be determined according to the service identifier, and the access address of the target restricted server and the target data description information can be sent to the browser through the socket link, so that the browser can generate a reference service request based on the access address of the target restricted server and the target data description information, and obtain the target data corresponding to the target data description information from the target restricted server based on the reference service request. Since the browser can access the restricted server, the browser can be used as a transfer station between the data request device and the restricted server, so as to solve the problem of restricted access of the data request device through the browser. In addition, the embodiment of the present application establishes a lightweight socket link between the data request device and the browser, and the access address of the target restricted server and the target data description information are transferred in the socket link, which is different from the business data in the Restful interface between the data request device and the browser, and is lightweight without affecting the original business.

[0098] See also Figure 4 , Figure 4 The schematic diagram of the structure of a data request device provided in an embodiment of the present application is as follows. The data request device may be the browser mentioned in the above method embodiment, and the data request device may include an acquisition unit 401 and a sending unit 402.

[0099] The acquisition unit 401 is used to acquire the access address and target data description information of the target restricted server from the local server through the socket link;

[0100] The sending unit 402 is used to generate a reference service request based on the access address of the target restricted server and the target data description information, and send the reference service request to the target restricted server;

[0101] The sending unit 402 is further configured to obtain target data from the target restricted server, and send the target data to the local server via the socket link, where the target data is data corresponding to the target data description information.

[0102] In some feasible implementations, the sending unit 402 is used to generate a reference service request based on the access address of the target restricted server and the target data description information, including:

[0103] Writing the target data description information into the target queue corresponding to the target restricted server based on the access address of the target restricted server; the data description information in the target queue is set to generate a reference service request according to the period and the access address of the target restricted server;

[0104] When the target cycle is reached, at least one data description information including the target data description information is taken out from the target queue, and a reference service request is generated based on the at least one data description information and the access address of the target restricted server.

[0105] In some feasible implementation manners, before the sending unit 402 is used to write the target data description information into the target queue corresponding to the target restricted server based on the access address of the target restricted server, the sending unit 402 is further used to:

[0106] Get the number of data description information in the target queue;

[0107] When the amount of data description information in the target queue is greater than the first threshold, the target data description information is discarded.

[0108] In some feasible implementation manners, before the sending unit 402 is used to write the target data description information into the target queue corresponding to the target restricted server based on the access address of the target restricted server, the sending unit 402 is further used to:

[0109] Get the number of data description information in the target queue;

[0110] When the amount of data description information in the target queue is greater than a first threshold, the target data description information is written into an alternative queue of the target restricted server, wherein the data description information included in the alternative queue of the target restricted server is set to be written back to the target queue when the amount of data description information included in the target queue is less than the first threshold.

[0111] According to another embodiment of the present application, Figure 4 The various units in the data request device shown can be separately or all combined into one or several other units to constitute, or one (some) of the units can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, other units can also be included based on the data request device. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0112] According to another embodiment of the present application, the system can include a central processing unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and other processing elements and storage elements. For example, a general computing device such as a computer can execute the following operations: Figure 2 A computer program (including program code) for each step involved in the corresponding method shown in Figure 4 The data request device shown in the figure is used to implement the data request method of the embodiment of the present application. The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the above-mentioned browser through the computer-readable recording medium and run therein.

[0113] In an embodiment of the present application, when the local server does not have the target data corresponding to the target service request, the access address of the target restricted server can be determined according to the service identifier, and the access address of the target restricted server and the target data description information can be sent to the data request device through the socket link, so that the data request device generates a reference service request based on the access address of the target restricted server and the target data description information, and obtains the target data corresponding to the target data description information from the target restricted server based on the reference service request. Since the data request device can access the restricted server, the data request device can be used as a transfer station between the local server and the restricted server, so as to solve the problem of limited access to the local server through the data request device. In addition, the embodiment of the present application establishes a lightweight socket link between the local server and the data request device, and the access address of the target restricted server and the target data description information are transferred in the socket link, which is different from the business data in the Restful interface between the local server and the data request device, and is lightweight without affecting the original business.

[0114] See also Figure 5 , Figure 5A structural diagram of a data request device provided for an embodiment of the present application. The data request device is the local server described above. The data request device may include: one or more processors 501; one or more input interfaces 502, one or more output interfaces 503 and a computer storage medium 504. The above-mentioned processor 501, input interface 502, output interface 503 and computer storage medium 504 are connected via a bus or other means. The computer storage medium 504 is a memory device in the data request device, which is used to store programs and data. It can be understood that the computer storage medium 504 here can include both the built-in storage medium of the data request device and, of course, the extended storage medium supported by the data request device. The computer storage medium 504 provides a storage space, which stores the operating system of the data request device. In addition, one or more instructions suitable for being loaded and executed by the processor 501 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory; optionally, it can also be at least one computer storage medium far away from the aforementioned processor. The processor can be called a central processing unit (CPU), which is the core and control center of the data request device, suitable for implementing one or more instructions, specifically loading and executing one or more instructions to realize the corresponding method flow or function.

[0115] In one embodiment, the processor 501 may load and execute one or more instructions stored in the computer storage medium 504 to implement the following operations: Figure 2 In the specific implementation, one or more instructions in the computer storage medium 504 are loaded by the processor 501 and the following steps are executed:

[0116] Obtain a target service request, which carries a service identifier and target data description information;

[0117] When the data requesting device does not have the target data corresponding to the target service request, determining the access address of the target restricted server according to the service identifier;

[0118] The access address of the target restricted server and the target data description information are sent to the browser through the socket link, so that the browser can obtain the target data corresponding to the target data description information from the target restricted server.

[0119] In some feasible implementation manners, before the processor 501 is used to send the access address of the target restricted server and the target data description information to the browser through the socket link, the processor 501 is also used to:

[0120] Call the first socket to listen for the connection request from the second socket of the browser;

[0121] When the first socket monitors the connection request of the second socket, the first socket is called to send the characteristic information of the first socket to the second socket of the browser, so that the browser calls the second socket to establish a socket link with the first socket of the data requesting device based on the characteristic information.

[0122] In some feasible implementations, the processor 501 is configured to call the first socket to send the characteristic information of the first socket to the second socket of the browser, so that after the browser calls the second socket to establish a socket link with the first socket of the data requesting device based on the characteristic information, the processor 501 is further configured to:

[0123] Get the current status of the socket link;

[0124] When the current state of the socket link is an open state, the step of sending the access address of the target restricted server and the target data description information to the browser through the socket link is triggered.

[0125] In an embodiment of the present application, when the data request device does not have the target data corresponding to the target service request, the access address of the target restricted server can be determined according to the service identifier, and the access address of the target restricted server and the target data description information can be sent to the browser through the socket link, so that the browser can generate a reference service request based on the access address of the target restricted server and the target data description information, and obtain the target data corresponding to the target data description information from the target restricted server based on the reference service request. Since the browser can access the restricted server, the browser can be used as a transfer station between the data request device and the restricted server, so as to solve the problem of restricted access of the data request device through the browser. In addition, the embodiment of the present application establishes a lightweight socket link between the data request device and the browser, and the access address of the target restricted server and the target data description information are transferred in the socket link, which is different from the business data in the Restful interface between the data request device and the browser, and is lightweight without affecting the original business.

[0126] See also Figure 6 , Figure 6A structural diagram of another data request device provided for an embodiment of the present application. The data request device is the browser described above. The data request device may include: one or more processors 601; one or more input interfaces 602, one or more output interfaces 603 and a computer storage medium 604. The above-mentioned processor 601, input interface 602, output interface 603 and computer storage medium 604 are connected via a bus or other means. The computer storage medium 604 is a memory device in the data request device, which is used to store programs and data. It can be understood that the computer storage medium 604 here can include both the built-in storage medium of the data request device and, of course, the extended storage medium supported by the data request device. The computer storage medium 604 provides a storage space, which stores the operating system of the data request device. In addition, one or more instructions suitable for being loaded and executed by the processor 601 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory; optionally, it can also be at least one computer storage medium far away from the aforementioned processor. The processor can be called a central processing unit (CPU), which is the core and control center of the data request device, suitable for implementing one or more instructions, specifically loading and executing one or more instructions to realize the corresponding method flow or function.

[0127] In one embodiment, the processor 601 may load and execute one or more instructions stored in the computer storage medium 604 to implement the following operations: Figure 2 In the specific implementation, one or more instructions in the computer storage medium 604 are loaded by the processor 601 and the following steps are executed:

[0128] Obtain the access address and target data description information of the target restricted server from the local server through the socket link;

[0129] Generate a reference service request based on the access address of the target restricted server and the target data description information, and send the reference service request to the target restricted server;

[0130] The target data from the target restricted server is obtained, and the target data is sent to the local server through the socket link, where the target data is data corresponding to the target data description information.

[0131] In some feasible implementations, the processor 601 is configured to generate a reference service request based on the access address of the target restricted server and the target data description information, including:

[0132] Writing the target data description information into the target queue corresponding to the target restricted server based on the access address of the target restricted server; the data description information in the target queue is set to generate a reference service request according to the period and the access address of the target restricted server;

[0133] When the target cycle is reached, at least one data description information including the target data description information is taken out from the target queue, and a reference service request is generated based on the at least one data description information and the access address of the target restricted server.

[0134] In some feasible implementation manners, before the processor 601 is used to write the target data description information into the target queue corresponding to the target restricted server based on the access address of the target restricted server, the processor 601 is further used to:

[0135] Get the number of data description information in the target queue;

[0136] When the amount of data description information in the target queue is greater than the first threshold, the target data description information is discarded.

[0137] In some feasible implementation manners, before the processor 601 is used to write the target data description information into the target queue corresponding to the target restricted server based on the access address of the target restricted server, the processor 601 is further used to:

[0138] Get the number of data description information in the target queue;

[0139] When the amount of data description information in the target queue is greater than a first threshold, the target data description information is written into an alternative queue of the target restricted server, wherein the data description information included in the alternative queue of the target restricted server is set to be written back to the target queue when the amount of data description information included in the target queue is less than the first threshold.

[0140] In an embodiment of the present application, when the local server does not have the target data corresponding to the target service request, the access address of the target restricted server can be determined according to the service identifier, and the access address of the target restricted server and the target data description information can be sent to the data request device through the socket link, so that the data request device generates a reference service request based on the access address of the target restricted server and the target data description information, and obtains the target data corresponding to the target data description information from the target restricted server based on the reference service request. Since the data request device can access the restricted server, the data request device can be used as a transfer station between the local server and the restricted server, so as to solve the problem of limited access to the local server through the data request device. In addition, the embodiment of the present application establishes a lightweight socket link between the local server and the data request device, and the access address of the target restricted server and the target data description information are transferred in the socket link, which is different from the business data in the Restful interface between the local server and the data request device, and is lightweight without affecting the original business.

[0141] The present application also provides a computer-readable storage medium in an embodiment, wherein the computer-readable storage medium stores computer program instructions. When the computer program instructions are executed by a processor, the steps executed in the above data request method embodiment can be executed.

[0142] An embodiment of the present application further provides a computer program product, which includes a computer program code. When the computer program code is executed on a computer, the computer executes the steps executed in the above data request method embodiment.

[0143] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM). The computer-readable storage medium can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of blockchain nodes, etc.

[0144] What is disclosed above is only a preferred embodiment of the present application, and it certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present application are still within the scope of the invention.

Claims

1. A data request method, characterized in that: include: The local server obtains a target service request, where the target service request carries a service identifier and target data description information; The local server is a front-end server deployed based on the webpack architecture, a front-end server deployed based on the node architecture, or a back-end server deployed based on the Java architecture in the microservice architecture; When the local server does not have the target data corresponding to the target service request, the local server determines the access address of the target restricted server according to the service identifier; The local server obtains the current state of the socket link between the local server and the browser; the state of the socket link is open or closed; When the current state of the socket link is an open state, the local server sends the access address of the target restricted server and the target data description information to the browser through the socket link; The browser generates a reference service request based on the access address of the target restricted server and the target data description information, and sends the reference service request to the target restricted server; The browser obtains target data from the target restricted server and performs anomaly detection on the target data; If the detection result of the target data is abnormal, the browser intercepts the target data, generates an alarm message, and forwards the alarm message to the local server; If the detection result of the target data is normal, the target data is sent to the local server through the socket link, and the target data is the data corresponding to the target data description information.

2. The method according to claim 1, characterized in that Before the local server sends the access address of the target restricted server and the target data description information to the browser via the socket link, the method further includes: The local server calls the first socket to listen to the connection request from the second socket of the browser; When the first socket monitors the connection request of the second socket, the local server calls the first socket to send the characteristic information of the first socket to the second socket of the browser; The browser calls the second socket to establish the socket link with the first socket of the local server based on the characteristic information.

3. The method according to claim 1, characterized in that The browser generates a reference service request based on the access address of the target restricted server and the target data description information, including: The browser writes the target data description information into a target queue corresponding to the target restricted server based on the access address of the target restricted server; the data description information in the target queue is set to generate a reference service request according to the access address of the target restricted server periodically; When the target cycle is reached, the browser takes out at least one data description information including the target data description information from the target queue, and generates the reference service request based on the at least one data description information and the access address of the target restricted server.

4. The method according to claim 3, characterized in that Before the browser writes the target data description information into the target queue corresponding to the target restricted server based on the access address of the target restricted server, the method further includes: The browser obtains the amount of data description information in the target queue; When the amount of data description information in the target queue is greater than a first threshold, the browser discards the target data description information.

5. The method according to claim 3, characterized in that Before the browser writes the target data description information into the target queue corresponding to the target restricted server based on the access address of the target restricted server, the method further includes: The browser obtains the amount of data description information in the target queue; When the amount of data description information in the target queue is greater than a first threshold, the browser writes the target data description information into an alternative queue of the target restricted server, wherein the data description information included in the alternative queue of the target restricted server is set to be written back to the target queue when the amount of data description information included in the target queue is less than the first threshold.

6. A data request system, characterized in that: The data request system includes a local server and a browser, wherein: The local server is used to obtain a target service request, which carries a service identifier and target data description information; when the local server does not have the target data corresponding to the target service request, the access address of the target restricted server is determined according to the service identifier, and the current state of the socket link between the browser is obtained, and the state of the socket link is open or closed; when the current state of the socket link is open, the access address of the target restricted server and the target data description information are sent to the browser through the socket link; the local server is a front-end server deployed based on the webpack architecture, a front-end server deployed based on the node architecture, or a back-end server deployed based on the Java architecture in the microservice architecture; The browser is used to generate a reference service request based on the access address of the target restricted server and the target data description information, and send the reference service request to the target restricted server; obtain the target data from the target restricted server, and perform anomaly detection on the target data; if the detection result of the target data is abnormal, the browser intercepts the target data, generates an alarm message, and forwards the alarm message to the local server; if the detection result of the target data is normal, send the target data to the local server through the socket link, and the target data is the data corresponding to the target data description information.

7. The system according to claim 6, characterized in that The browser is used to generate a reference service request based on the access address of the target restricted server and the target data description information, including: The browser is used to write the target data description information into the target queue corresponding to the target restricted server based on the access address of the target restricted server; the data description information in the target queue is set to generate a reference service request according to the access address of the target restricted server in a periodic manner; When the target cycle is reached, at least one data description information including the target data description information is taken out from the target queue, and the reference service request is generated based on the at least one data description information and the access address of the target restricted server.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, they are used to execute the data request method according to any one of claims 1 to 5.