CN114401307A - Data request method, system and storage medium - Google Patents

Data request method, system and storage medium Download PDF

Info

Publication number
CN114401307A
CN114401307A CN202210059860.7A CN202210059860A CN114401307A CN 114401307 A CN114401307 A CN 114401307A CN 202210059860 A CN202210059860 A CN 202210059860A CN 114401307 A CN114401307 A CN 114401307A
Authority
CN
China
Prior art keywords
target
description information
server
browser
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210059860.7A
Other languages
Chinese (zh)
Inventor
刘永妮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An International Smart City Technology Co Ltd
Original Assignee
Ping An International Smart City Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202210059860.7A priority Critical patent/CN114401307A/en
Publication of CN114401307A publication Critical patent/CN114401307A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application provides a data request method, a data request system and a storage medium, which relate to the technical field of artificial intelligence and comprise the following steps: the method comprises the steps that a local server side obtains a target service request carrying a service identifier and target data description information, when target data corresponding to the target service request do not exist in the local server side, an access address of a target limited server side is determined according to the service identifier, the access address of the target limited server side and the target data description information are sent to a browser through a socket link, and therefore the target data corresponding to the target data description information are obtained from the target limited server side through the browser. The problem that the access of the local server is limited can be solved. The present application may relate to blockchain techniques, such as target data may be written into a blockchain. The application also relates to the field of digital medical technology, such as including data of the field of digital medical technology in the target data.

Description

Data request method, system and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data requesting method, system, and storage medium.
Background
When the target server sets a restricted access to the local server, the local server may not access the target server, and at this time, the efficient development process may be blocked. Therefore, how to solve the problem of limited access of the local server is an important research topic.
Disclosure of Invention
The embodiment of the application provides a data request method, a data request system and a storage medium, wherein a service request of a local server is forwarded to a browser through a socket link, so that the browser accesses a limited server, and the problem of limited access of the local server is solved.
In a first aspect, an embodiment of the present application provides a data request method, where the data request method includes:
a local server side acquires a target service request, wherein the target service request carries a service identifier and target data description information;
when the local server does not have target data corresponding to the target service request, the local server determines an access address of a target limited server according to the service identifier;
the local server side sends the access address of the target limited server side 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 limited service end and the target data description information, and sends the reference service request to the target limited service end;
the browser acquires target data from the target limited server and sends the target data to the local server through the socket link, wherein the target data is data corresponding to the target data description information.
In a second aspect, an embodiment of the present application provides a data request system, where the data request system includes a local server and a browser, where:
the local server is used for acquiring a target service request, and the target service request carries a service identifier and target data description information; when the local server does not have target data corresponding to the target service request, determining an access address of the target limited server according to the service identifier, and sending the access address of the target limited server and the target data description information to the browser through a socket link;
the browser is used for generating a reference service request based on the access address of the target limited service end and the target data description information and sending the reference service request to the target limited service end; and acquiring target data from the target limited server, and sending the target data to the local server through the socket link, wherein the target data is data corresponding to the target data description information.
In a third aspect, an embodiment of the present application provides a data request apparatus, including:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a target service request which carries a service identifier and target data description information;
the determining unit is used for determining an access address of a target limited server according to the service identifier when the data requesting device does not have target data corresponding to the target service request;
and the sending unit is used for sending the access address of the target limited 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 limited server through the browser.
In a fourth aspect, an embodiment of the present application further provides another data request apparatus, where the data request apparatus includes:
the acquisition unit is used for acquiring an access address of a target limited server from a local server and target data description information through a socket link;
the sending unit is used for generating a reference service request based on the access address of the target limited service end and the target data description information and sending the reference service request to the target limited service end;
the sending unit is further used for obtaining target data from the target limited server and sending the target data to the local server through the socket link, wherein the target data is data corresponding to the target data description information.
In a fifth aspect, an embodiment of the present application provides a data request device, where the data request device includes an input interface and an output interface, and the data request device further includes:
a processor adapted to implement one or more instructions; and the number of the first and second groups,
a computer storage medium storing one or more instructions adapted to be loaded and executed by a processor to:
acquiring a target service request, wherein the target service request carries a service identifier and target data description information;
when the data request equipment does not have target data corresponding to the target service request, determining an access address of a target limited service end according to the service identifier;
and sending the access address of the target limited 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 limited server through the browser.
In a sixth aspect, an embodiment of the present application further provides another data request device, where the data request device includes an input interface and an output interface, and the data request device further includes:
a processor adapted to implement one or more instructions; and the number of the first and second groups,
a computer storage medium storing one or more instructions adapted to be loaded and executed by a processor to:
acquiring an access address of a target limited server from a local server and target data description information through a socket link;
generating a reference service request based on the access address of the target limited server and the target data description information, and sending the reference service request to the target limited server;
and acquiring target data from the target limited server, and sending the target data to the local server through the socket link, wherein the target data is data corresponding to the target data description information.
In a seventh aspect, this application further provides a computer-readable storage medium, where computer program instructions are stored, and when executed by a processor, are configured to perform the method of the first aspect.
In the embodiment of the application, when the local server does not have target data corresponding to the target service request, the access address of the target limited server can be determined according to the service identifier, and the access address of the target limited server and the target data description information are sent to the browser through the socket link, so that the browser generates a reference service request based on the access address of the target limited server and the target data description information, and obtains the target data corresponding to the target data description information from the target limited server based on the reference service request. Since the browser can access the limited service end, the browser can be used as a transfer station between the local service end and the limited service end, so that the problem of limited access of the local service end is solved through the browser. In addition, a lightweight socket link is established between the local server and the browser, the access address of the target limited server and the target data description information are transferred in the socket link, and the method is different from business data in Restful type interfaces of the local server and the browser, and does not affect original business while being lightweight.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic architecture diagram of a data request system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a data requesting method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data request apparatus according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of another data request apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data request device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another data request device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
With the development of internet technology, more and more micro-service applications are emerging in daily life. At present, in the service division process, a single application is split into a plurality of high-cohesion low-coupling small services, each small service runs a process independently, the small services are micro services, the front end and the rear end of each micro service are developed and maintained by different teams, a lightweight communication mechanism is adopted between the services, the services are independently and automatically deployed, and different languages and storage can be adopted.
Because the micro services are independent from each other, or the front end and the back end of each micro service are also independent, for any one local server in the micro service architecture (the local server includes the micro service, the front end server in the micro service, or the back end server in the micro service, etc.), the local server and other servers except the local server in the micro service architecture may be independent from each other, and the local server may not be able to access other servers except the local server in the micro service architecture, which may cut off the efficient development process. For example, when a front-end service in the micro-service is deployed based on the webpack architecture, the front-end service in the micro-service may not access other services in the micro-service architecture, which may result in that debugging cannot be performed and data cannot be cached for research and development before joint debugging.
Through comparison research, the browser can access any server side in the micro-service architecture, and the local server side can establish data connection with the browser through a socket link. Based on this, the embodiment of the present application provides a data request scheme, and the principle of the scheme is roughly as follows: a socket link can be established between the browser and the local server, when target data corresponding to the target service request does not exist in the local server, the access address of the target limited server and the target data description information can be sent to the browser through the socket link, so that the target data corresponding to the target data description information can be obtained from the target limited server through the browser, and the problem that the local server is limited in access can be solved.
The data request scheme mentioned in the embodiment of the present application may be applied to a data request system as shown in fig. 1, and as shown in fig. 1, the data request system may include at least a browser 11, a local server 12, and a plurality of restricted servers 13 (e.g., a restricted server 13a or a restricted server 13b shown in fig. 1). Data interaction can be performed between the browser 11 and the local server 12 through an interface in the form of Restful, and data interaction can also be performed between the browser 11 and the limited server 13 through an interface in the form of Restful. The browser 11 may be deployed in a terminal device on the user side, where the terminal device may include but is not limited to: smart phones, tablets, laptops, wearable devices, desktop computers, and the like. The local server 12 may be deployed in a server, which may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a Content Delivery Network (CDN), a middleware service, a domain name service, a security service, a big data and artificial intelligence platform, and the like. The limited server is similar to the local server, and the limited server can also be deployed in the server. The embodiment of the present application does not limit this.
For the data request system shown in fig. 1, the local server 12 may be configured to obtain a target service request, where the target service request carries a service identifier and target data description information; when the local server 12 does not have target data corresponding to the target service request, the local server 12 is configured to determine an access address of the target limited server according to the service identifier, and send the access address of the target limited server and the target data description information to the browser 11 through the socket link. The browser 11 is configured to generate a reference service request based on the access address of the target limited server and the target data description information, and send the reference service request to the target limited server; and acquiring target data from the target limited server, and sending the target data to the local server 12 through the socket link, wherein the target data is data corresponding to the target data description information. The target restricted server mentioned here may be any restricted server in the plurality of restricted servers 13 in fig. 1.
Based on the above description, the data request method of the embodiment of the present application is set forth in detail below. Referring to fig. 2, fig. 2 illustrates a data request method. As shown in fig. 2, the data request method includes S201 to S207:
s201: the local server side obtains a target service request, and the target service request carries a service identifier and target data description information.
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 the micro-service architecture. This is not limited in this application.
The service request is used for acquiring the data indicated by the data description information. The service request may include service identification and data description information. The service identifier may be used to indicate an acquisition address of the data, and the data description information may be used to indicate characteristics of the data (e.g., request parameters of the data, etc.). Based on this, for the target service request, the target service request may include therein a service identifier indicating an acquisition address of the target data and target data description information indicating a feature of the target data.
Alternatively, the target service request may be generated by the local server. Specifically, the local server may generate target data description information of the target data, call a script instruction to obtain a service identifier corresponding to the target data description information, and generate the target service request based on the target data description information and the service identifier. Alternatively, the target service request may be generated by the browser. Specifically, the browser may display a user interface, obtain target data description information and a service identifier of the target data in response to a user operation in the user interface, and generate the 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 an interface in the form of Restful, so that the local server may obtain the target service request.
S202: and when the local server does not have target data corresponding to the target service request, the local server determines the access address of the target limited server according to the service identifier.
In an embodiment, the local server may perform lookup in the local database according to the target data description information in the target service request, and when the local server may find the target data corresponding to the target data description information in the local database, the local server may directly use the target data as response data of the target service request. When the local server does not 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 limited server except the local server in the micro-service architecture.
Optionally, one local server may correspond to multiple restricted servers. When the local server does not find the target data corresponding to the target data description information, the access address of the target limited server can be determined according to the service identifier carried by the target service request. As shown in fig. 1, one local server may correspond to the limited server 13a and the limited server 13 b. When the service identifier carried by the target service request indicates that the target limited server is the limited server 13a, the access address of the limited server 13a may be determined as the access address of the target limited server. When the service identifier carried by the target service request indicates that the target limited server is the limited server 13b, the access address of the limited server 13b may be determined as the access address of the target limited server.
The service identifier may be represented in various manners, and may include one or more of numbers, letters, and characters. Alternatively, the service identifier may be an independent identifier. Alternatively, the service identification may be associated with the service request, e.g. the service identification is a suffix of the target service request. Optionally, the service identifier may also be associated with the target description information, for example, the service identifier may be a fixed field in the target description information, and the like.
S203: and the local server sends the access address of the target limited server and the target data description information to the browser through the socket link.
In one embodiment, the local server needs to establish a socket link before sending the access address of the target limited server and the target data description information to the browser through the socket link. Namely, a socket link is established between the local server and the browser.
The socket link is a lightweight communication link supporting TCP/IP network communication, and both communication parties can complete a communication process by using a related function in the socket. The first socket can be created on the local server side, the second socket can be created on the browser side, and a socket link between the first socket and the second socket is used as a socket link between the local server side and the browser. Optionally, the local server may be used as a server of the socket link, and the browser may be used as a client of the socket link, that is, a first socket created on the local server side is a server socket (e.g., server socket), and a second socket is created on the browser side is a client socket (e.g., websocket).
Optionally, the establishment process of the socket link may be divided into three steps: monitoring of a server socket, initiating a request of a client socket and confirming the connection of a socket link. Specifically, the local server may call the first socket to monitor a connection request from the second socket of the browser, and when the local server calls the first socket to monitor a connection request from the second socket of the browser, the local server calls the first socket to send the feature 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 feature information. That is to say, the server socket in the state of waiting for connection monitors the connection request of the websocket in real time, when the server socket monitors the connection request of the websocket, the characteristic information of the server socket can be sent to the websocket in response to the connection request of the websocket, and when the websocket receives the description information of the serv socket, the socket connection is established.
In one embodiment, further, to avoid resource waste, two states may be set for the socket link: an on state and an off 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 resources. Therefore, when data interaction through the socket link is not needed, the socket link can be adjusted to be in a closed state, and resources are saved. 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.
Based on the above description, in an embodiment, in order to guarantee socket communication between the local server and the browser while saving resources, after the socket link is established and/or before the access address of the target limited server and the target data description information are sent to the browser through the socket link, the local server may obtain the current state of the socket link, and when the current state of the socket link is an open state, trigger execution of the step of sending the access address of the target limited server and the target data description information to the browser through the socket link. And when the current state of the socket link is a closed state, the step of sending the access address of the target limited server and the target data description information to the browser through the socket link cannot be executed.
Alternatively, the current state of the socket link may be indicated with an identification bit. Alternatively, the identification bit may be a field. For example, when the identification bit is the first field, the local server determines that the current state of the socket link is an open state, and when the identification bit is the second field, the local server determines that the current state of the socket link is a closed state. Wherein the first field and the second field mentioned above refer to different fields, for example, the first field may be "true" and the second field may be "false"; alternatively, the first field may be "false" and the second field may be "true".
Optionally, the identification bit may also be a bit. For example, when the identification bit is a first bit value, the local server determines that the current state of the socket link is an open state, and when the identification bit is a second bit value, the local server determines that the current state of the socket link is a closed state. Wherein the first bit value and the second bit value mentioned above refer to different bit values, for example, the first bit value may be "0", and the second bit value may be "1"; alternatively, the first bit value may be "1", the second bit value may be "0", and so on.
S204: and the browser generates a reference service request based on the access address of the target limited service end and the target data description information.
In one embodiment, in order to save resources, the browser may integrate the data description information accessing the same restricted service end, so as to obtain data corresponding to a plurality of data description information at the same time by referring to the service request once. In specific implementation, a corresponding queue may be set for each restricted server. The data description information in the corresponding queue of each limited service end is set to generate a reference service request according to the period and the access address of the limited service end. Therefore, when the browser acquires the access address of the target limited server and the target data description information, the target data description information can be written into a target queue corresponding to the target limited server based on the access address of the target limited server, when the target period is reached, at least one piece of 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 piece of data description information and the access address of the target limited server.
The queue mentioned above may 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 limited server may be different. Optionally, the number of data description information fetched each time may be all data description information included in the queue. Optionally, the number of the data description information extracted each time is a preset number M, where M is a positive integer, and M may be a fixed number or data associated with the target period. For example, M is inversely related to the period. The period corresponding to each queue may be preset, and may be specifically set according to service requirements and experience.
In one embodiment, to avoid causing congestion, the queue of the limited server may also be set to a fixed length (i.e., to set the maximum amount of data description information included in the queue). Then, before writing the target data description information into the target queue corresponding to the target limited server based on the access address of the target limited server, it is further required to determine whether the number of data description information in the target queue corresponding to the target limited server is greater than a first threshold. Specifically, the number of the data description information in the target queue may be obtained, and in a case that the number of the data description information included in the target queue is greater than a first threshold, the target data description information request is discarded, or the target data description information is written into an alternative queue of the target limited server, where the data description information included in the alternative queue of the target limited server is set to be written back into the target queue in a case that the number of the data description information included in the target queue is less than the first threshold.
Optionally, the maximum amount of the data description information set in the target queue, that is, the first threshold is fixed, and when the first threshold is exceeded, the subsequent data description information cannot be written into the target queue any more, so that congestion is avoided, and before the data description information is taken out from the target queue regularly and quantitatively, the data description information in the target queue is controlled, so that the pressure of the target queue is reduced.
Optionally, when the number of requests in the target queue is greater than the first threshold, the target data description information may be processed in two ways, i.e., directly discarded, and i.e., written into the alternative queue of the target limited server. The alternative queues of the target limited server can also be set to a maximum number, and when the alternative queues of the target limited server are full, the subsequent data description information is directly discarded. For example, the first threshold of the target queue of the target limited server may be 100, and after the target queue of the target limited server is full of 100 pieces of data description information, the 101 th data description information may be directly discarded, or may be written into an alternative queue of the target limited server. Further, the predetermined threshold of the alternative queue of the target limited server may also be set to 100, and when the alternative queue of the target limited server is also full of the data description information, the 201 th data description information is also discarded. It should be noted that the predetermined threshold of the candidate queue of the target limited server may be the same as or different from the first threshold of the target queue of the target limited server.
Optionally, when the target queue of the target limited server works normally, the alternative queue of the target limited server exists as a standby queue. When the number of the data description information in the target queue of the target limited server is less than the first threshold), part of the data description information in the alternative queue of the target limited server may be written back to the target queue of the target limited server. Further, when the number of the data description information in the target queue of the target limited server is less than a second threshold (for example, 50), part of the data description information in the alternative queue of the target limited server may be written back to the target queue of the target limited server.
Optionally, when the target queue of the target limited server fails, the data description information in the target queue of the target limited server may be written into the alternative queue of the target limited server, so as to avoid data loss.
S205: and the browser sends the reference service request to the target limited service end.
Specifically, as data interaction can be performed between the browser and the target limited server through the Restful interface, the reference service request can be sent to the target limited server through the Restful interface.
The reference service request may be a service request supporting interaction between the browser and the limited service end, such as an Ajax request. The Ajax is called Asynchronous Javascript AndXML, namely Asynchronous JavaScript and XML, and refers to a webpage development technology for creating interactive webpage application.
S206: and the target limited server returns target data, wherein the target data is data corresponding to the target data description information.
In one embodiment, when the target limited server side acquires the target data description information in response to the reference service request, the target limited server side may search the target database for corresponding target data according to the target data description information, and return the target data to the browser, so that the browser may acquire the target data from the target limited server side. It should be noted that, if the reference service request includes at least one piece of data description information including the target data description information, the target limited service end may search, according to each piece of data description information, data corresponding to each piece of data description information in the target database, and return the data corresponding to each piece of data description information to the browser, which is not described herein again.
In an embodiment, in order to ensure security, when the browser acquires target data from the target limited server, the browser may further perform anomaly detection on the target data from the target limited server, and when a detection result of the target data is normal, the target data may be forwarded to the local server through a socket link. When the detection result of the target data is abnormal, the browser can intercept the target data, generate an alarm message and forward the alarm message to the local server. The anomaly detection includes, but is not limited to, determining whether the data is a garbled data or whether the data is a plurality of times of repeated data, and the like.
Alternatively, the target data may be medical data, such as personal health records, prescriptions, examination reports, and the like.
S207: and the browser sends the target data to the local server through the socket link.
The browser sends the target data to the local server through the socket link, and the target data are used as response data of the target service request. Further, in order to ensure the integrity of data transmission, in the case that the target service request is generated by the browser, the local server needs to send the target data to the browser. The local server can send the target data to the browser through an interface in a Restful form.
In one embodiment, the local server receives the target data from the browser, and in order to avoid data loss, the target data may also be written into a Block Chain (Block Chain) so as to directly call the target data corresponding to the target description information in the subsequent. Specifically, the target data can be verified, and if the verification is passed, the target data is subjected to consensus verification through a consensus node in the block chain network; and if the consensus verification is passed, packaging the target data into a block, and writing the block into a block chain.
The block chain is a chain data structure formed by combining data blocks in a sequential connection mode according to a time sequence, and a distributed account book which can not be tampered and forged of data is guaranteed in a cryptographic mode. Multiple independent distributed nodes maintain the same record. The blockchain technology realizes decentralization and becomes a foundation for credible digital asset storage, transfer and transaction.
In the embodiment of the application, when the local server does not have target data corresponding to the target service request, the access address of the target limited server can be determined according to the service identifier, and the access address of the target limited server and the target data description information are sent to the browser through the socket link, so that the browser generates a reference service request based on the access address of the target limited server and the target data description information, and obtains the target data corresponding to the target data description information from the target limited server based on the reference service request. Since the browser can access the limited service end, the browser can be used as a transfer station between the local service end and the limited service end, so that the problem of limited access of the local service end is solved through the browser. In addition, a lightweight socket link is established between the local server and the browser, the access address of the target limited server and the target data description information are transferred in the socket link, and the method is different from business data in Restful type interfaces of the local server and the browser, and does not affect original business while being lightweight.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a data request apparatus according to an embodiment of the present disclosure. The data request device may be the local server mentioned in the foregoing method embodiments, and the data request device may include an obtaining unit 301, a determining unit 302, and a sending unit 303.
An obtaining unit 301, configured to obtain a target service request, where the target service request carries a service identifier and target data description information;
a determining unit 302, configured to determine, according to the service identifier, an access address of the target limited server when the data requesting apparatus does not have target data corresponding to the target service request;
the sending unit 303 is configured to send the access address of the target limited server and the target data description information to the browser through the socket link, so as to obtain, by the browser, target data corresponding to the target data description information from the target limited server.
In some possible embodiments, before the sending unit 303 is configured to send the access address of the target limited server and the target data description information to the browser through the socket link, the sending unit 303 is further configured to:
calling a first socket to monitor a connection request of a second socket from the browser;
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 request device based on the characteristic information.
In some possible embodiments, the sending unit 303 is configured to invoke the first socket to send the feature information of the first socket to a second socket of the browser, so that after the browser invokes the second socket to establish a socket link with the first socket of the data requesting device based on the feature information, the sending unit 303 is further configured to:
acquiring the current state of a socket link;
and when the current state of the socket link is an open state, triggering and executing the step of sending the access address of the target limited server and the target data description information to the browser through the socket link.
According to another embodiment of the present application, the units in the data requesting apparatus shown in fig. 3 may be respectively or entirely combined into one or several other units to form the data requesting apparatus, or some unit(s) thereof may be further split into multiple functionally smaller units to form the data requesting apparatus, which may achieve the same operation without affecting the achievement of the technical effect of the embodiment of the present application. The units are divided based on logic functions, and in practical applications, the functions of one unit may be implemented by a plurality of units, or the functions of a plurality of units may be implemented by one unit. In other embodiments of the present application, the data-based request apparatus may also include other units, and in practical applications, these functions may also be implemented by being assisted by other units, and may be implemented by cooperation of multiple units.
According to another embodiment of the present application, the Processing element and the memory element may include a Central Processing Unit (CPU), a random access memory medium (RAM), a read only memory medium (ROM), and the like. A general purpose computing device, such as a computer, runs a computer program (including program code) capable of executing the steps involved in the corresponding method shown in fig. 2 to construct a data request apparatus shown in fig. 3 and to implement the data request method of the embodiment of the present application. The computer program may be, for example, recorded on a computer-readable recording medium, and loaded and executed in the local service via the computer-readable recording medium.
In this embodiment of the application, when the data request device does not have target data corresponding to the target service request, the access address of the target limited server may be determined according to the service identifier, and the access address of the target limited server and the target data description information are sent to the browser through the socket link, so that the browser generates a reference service request based on the access address of the target limited server and the target data description information, and obtains the target data corresponding to the target data description information from the target limited server based on the reference service request. Since the browser can access the limited service end, the browser can be used as a transfer station between the data request device and the limited service end, so that the problem of limited access of the data request device can be solved through the browser. In addition, a lightweight socket link is established between the data request device and the browser, and the access address of the target limited server and the target data description information are transferred in the socket link, so that the method is different from service data in Restful type interfaces of the data request device and the browser, and the original service is not influenced while the weight is reduced.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a data request apparatus according to an embodiment of the present disclosure. The data request device may be the browser mentioned in the foregoing method embodiment, and the data request device may include an obtaining unit 401 and a sending unit 402.
The obtaining unit 401 is configured to obtain, through a socket link, an access address and target data description information of a target limited server from a local server;
the sending unit 402 is configured to generate a reference service request based on the access address of the target limited server and the target data description information, and send the reference service request to the target limited server;
the sending unit 402 is further configured to obtain target data from the target limited 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.
In some possible embodiments, the sending unit 402 is configured to generate the reference service request based on the access address of the target limited server and the target data description information, and includes:
writing target data description information into a target queue corresponding to the target limited server based on the access address of the target limited server; the data description information in the target queue is set to generate a reference service request according to a period and an access address of a target limited service end;
and when the target period is reached, taking out at least one piece of data description information including the target data description information from the target queue, and generating a reference service request based on the at least one piece of data description information and the access address of the target limited service terminal.
In some possible embodiments, before the sending unit 402 is configured to write the target data description information into the target queue corresponding to the target limited server based on the access address of the target limited server, the sending unit 402 is further configured to:
acquiring the quantity of data description information in a target queue;
and in the case that the number of the data description information in the target queue is larger than a first threshold value, discarding the target data description information.
In some possible embodiments, before the sending unit 402 is configured to write the target data description information into the target queue corresponding to the target limited server based on the access address of the target limited server, the sending unit 402 is further configured to:
acquiring the quantity of data description information in a target queue;
and writing the target data description information into the alternative queue of the target limited server under the condition that the number of the data description information in the target queue is greater than a first threshold, wherein the data description information included in the alternative queue of the target limited server is set to be written back into the target queue under the condition that the number of the data description information included in the target queue is less than the first threshold.
According to another embodiment of the present application, the units in the data requesting apparatus shown in fig. 4 may be respectively or entirely combined into one or several other units to form the data requesting apparatus, or some unit(s) thereof may be further split into multiple functionally smaller units to form the data requesting apparatus, which may achieve the same operation without affecting the achievement of the technical effect of the embodiment of the present application. The units are divided based on logic functions, and in practical applications, the functions of one unit may be implemented by a plurality of units, or the functions of a plurality of units may be implemented by one unit. In other embodiments of the present application, the data-based request apparatus may also include other units, and in practical applications, these functions may also be implemented by being assisted by other units, and may be implemented by cooperation of multiple units.
According to another embodiment of the present application, the Processing element and the memory element may include a Central Processing Unit (CPU), a random access memory medium (RAM), a read only memory medium (ROM), and the like. A general purpose computing device, such as a computer, runs a computer program (including program code) capable of executing the steps involved in the corresponding method shown in fig. 2, to construct a data request apparatus shown in fig. 4, and to implement the data request method of the embodiments of the present application. The computer program may be, for example, recorded on a computer-readable recording medium, and loaded and executed in the browser through the computer-readable recording medium.
In the embodiment of the application, when the local server does not have target data corresponding to the target service request, the access address of the target limited server can be determined according to the service identifier, and the access address of the target limited server and the target data description information are 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 limited server and the target data description information, and obtains the target data corresponding to the target data description information from the target limited server based on the reference service request. Since the data request device can access the limited server, the data request device can be used as a transfer station between the local server and the limited server, so that the problem of limited access of the local server is solved through the data request device. In addition, a lightweight socket link is established between the local server and the data request device, and the access address of the target limited server and the target data description information are transferred in the socket link, so that the method is different from the service data in Restful type interfaces of the local server and the data request device, and the original service is not influenced while the weight is reduced.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a data request apparatus according to an embodiment of the present disclosure. 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 computer storage media 504. The processor 501, the input interface 502, the output interface 503, and the computer storage medium 504 are connected by a bus or other means. The computer storage medium 504 is a memory device in the data requesting device for storing programs and data. It is understood that the computer storage medium 504 herein may include both a built-in storage medium of the data request device and, of course, an extended storage medium supported by the data request device. Computer storage media 504 provides storage space that stores the operating system of the data requesting device. Also stored in this memory space are one or more instructions, which may be one or more computer programs (including program code), suitable for loading and execution by processor 501. Note that the computer storage media herein can be high-speed RAM memory; optionally, the system may further include at least one computer storage medium remote from the processor, where the processor may be referred to as a Central Processing Unit (CPU), and is a core of the data request device and a control center, and is adapted to implement one or more instructions, specifically load and execute the one or more instructions, so as to implement the corresponding method flow or function.
In one embodiment, one or more instructions stored in the computer storage medium 504 may be loaded and executed by the processor 501 to implement the steps involved in performing the corresponding method as shown in fig. 2, and in particular, one or more instructions in the computer storage medium 504 may be loaded and executed by the processor 501 to implement the steps of:
acquiring a target service request, wherein the target service request carries a service identifier and target data description information;
when the data request equipment does not have target data corresponding to the target service request, determining an access address of a target limited service end according to the service identifier;
and sending the access address of the target limited 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 limited server through the browser.
In some possible embodiments, before the processor 501 is configured to send the access address of the target limited server and the target data description information to the browser through the socket link, the processor 501 is further configured to:
calling a first socket to monitor a connection request of a second socket from the browser;
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 request device based on the characteristic information.
In some possible embodiments, the processor 501 is configured to invoke the first socket to send the feature information of the first socket to the second socket of the browser, so that after the browser invokes the second socket to establish a socket link with the first socket of the data request device based on the feature information, the processor 501 is further configured to:
acquiring the current state of a socket link;
and when the current state of the socket link is an open state, triggering and executing the step of sending the access address of the target limited server and the target data description information to the browser through the socket link.
In the embodiment of the application, when the data request device does not have target data corresponding to the target service request, the access address of the target limited server can be determined according to the service identifier, and the access address of the target limited server and the target data description information are sent to the browser through the socket link, so that the browser generates a reference service request based on the access address of the target limited server and the target data description information, and obtains the target data corresponding to the target data description information from the target limited server based on the reference service request. Since the browser can access the limited service end, the browser can be used as a transfer station between the data request device and the limited service end, so that the problem of limited access of the data request device is solved through the browser. In addition, a lightweight socket link is established between the data request device and the browser, the access address of the target limited server and the target data description information are transferred in the socket link, and the method is different from business data in Restful type interfaces of the data request device and the browser, and does not affect original business while being lightweight.
Referring to fig. 6, fig. 6 is a schematic structural diagram of another data requesting device according to an embodiment of the present disclosure. The data requesting 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 computer storage media 604. The processor 601, the input interface 602, the output interface 603, and the computer storage medium 604 are connected by a bus or other means. The computer storage medium 604 is a memory device in the data requesting device for storing programs and data. It is understood that the computer storage medium 604 herein may comprise a built-in storage medium of the data request device, and may also comprise an extended storage medium supported by the data request device. Computer storage media 604 provides storage space that stores the operating system of the data requesting device. Also stored in this memory space are one or more instructions, which may be one or more computer programs (including program code), suitable for loading and execution by processor 601. Note that the computer storage media herein can be high-speed RAM memory; optionally, the system may further include at least one computer storage medium remote from the processor, where the processor may be referred to as a Central Processing Unit (CPU), and is a core of the data request device and a control center, and is adapted to implement one or more instructions, specifically load and execute the one or more instructions, so as to implement the corresponding method flow or function.
In one embodiment, one or more instructions stored in the computer storage medium 604 may be loaded and executed by the processor 601 to implement the steps involved in performing the corresponding method as shown in fig. 2, and in particular, one or more instructions in the computer storage medium 604 may be loaded and executed by the processor 601 to implement the steps of:
acquiring an access address of a target limited server from a local server and target data description information through a socket link;
generating a reference service request based on the access address of the target limited server and the target data description information, and sending the reference service request to the target limited server;
and acquiring target data from the target limited server, and sending the target data to the local server through the socket link, wherein the target data is data corresponding to the target data description information.
In some possible embodiments, the processor 601 is configured to generate the reference service request based on the access address of the target limited server and the target data description information, and includes:
writing target data description information into a target queue corresponding to the target limited server based on the access address of the target limited server; the data description information in the target queue is set to generate a reference service request according to a period and an access address of a target limited service end;
and when the target period is reached, taking out at least one piece of data description information including the target data description information from the target queue, and generating a reference service request based on the at least one piece of data description information and the access address of the target limited service terminal.
In some possible embodiments, before the processor 601 is configured to write the target data description information into the target queue corresponding to the target limited server based on the access address of the target limited server, the processor 601 is further configured to:
acquiring the quantity of data description information in a target queue;
and in the case that the number of the data description information in the target queue is larger than a first threshold value, discarding the target data description information.
In some possible embodiments, before the processor 601 is configured to write the target data description information into the target queue corresponding to the target limited server based on the access address of the target limited server, the processor 601 is further configured to:
acquiring the quantity of data description information in a target queue;
and writing the target data description information into the alternative queue of the target limited server under the condition that the number of the data description information in the target queue is greater than a first threshold, wherein the data description information included in the alternative queue of the target limited server is set to be written back into the target queue under the condition that the number of the data description information included in the target queue is less than the first threshold.
In the embodiment of the application, when the local server does not have target data corresponding to the target service request, the access address of the target limited server can be determined according to the service identifier, and the access address of the target limited server and the target data description information are sent to the data request equipment through the socket link, so that the data request equipment generates a reference service request based on the access address of the target limited server and the target data description information, and obtains the target data corresponding to the target data description information from the target limited server based on the reference service request. Since the data request device can access the limited server, the data request device can be used as a transfer station between the local server and the limited server, so that the problem of limited access of the local server is solved through the data request device. In addition, a lightweight socket link is established between the local server and the data request device, and the access address of the target limited server and the target data description information are transferred in the socket link, so that the method is different from the service data in Restful type interfaces of the local server and the data request device, and the original service is not influenced while the weight is reduced.
A computer-readable storage medium having computer program instructions stored thereon is also provided in embodiments of the present application. The computer program instructions, when executed by the processor, may perform the steps performed in the above-described data request method embodiments.
An embodiment of the present application further provides a computer program product, where the computer program product includes computer program code, and when the computer program code runs on a computer, the computer is caused to execute the steps performed in the above data request method embodiment.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. The computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method of requesting data, comprising:
a local server side obtains a target service request, wherein the target service request carries a service identifier and target data description information;
when the local server does not have target data corresponding to the target service request, the local server determines an access address of a target limited server according to the service identifier;
the local server side sends the access address of the target limited server side and the target data description information to a browser through a socket link;
the browser generates a reference service request based on the access address of the target limited server and the target data description information, and sends the reference service request to the target limited server;
the browser acquires target data from the target limited server and sends the target data to the local server through the socket link, wherein the target data is data corresponding to the target data description information.
2. The method of claim 1, wherein before the local server sends the target restricted server access address and the target data description information to a browser through a socket link, the method further comprises:
the local server calls a first socket to monitor a connection request of a second socket from the browser;
when the first socket monitors the connection request of the second socket, the local server calls the first socket to send the feature information of the first socket to the second socket of the browser;
and 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 of claim 1 or 2, wherein before the local server sends the access address of the target restricted server and the target data description information to a browser through a socket link, the method further comprises:
the local server side obtains the current state of the socket link;
and when the current state of the socket link is an open state, the local server triggers and executes the step of sending the access address of the target limited server and the target data description information to a browser through the socket link.
4. The method of claim 1, wherein the browser generating a reference service request based on the access address of the target restricted server and the target data description information comprises:
the browser writes the target data description information into a target queue corresponding to the target limited server based on the access address of the target limited server; the data description information in the target queue is set to generate a reference service request according to a period and the access address of the target limited service terminal;
when the target period is reached, the browser takes out at least one piece of 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 piece of data description information and the access address of the target limited service terminal.
5. The method of claim 4, wherein before 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 method further comprises:
the browser acquires the quantity of the data description information in the target queue;
and the browser discards the target data description information under the condition that the quantity of the data description information in the target queue is greater than a first threshold value.
6. The method of claim 4, wherein before 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 method further comprises:
the browser acquires the quantity of the data description information in the target queue;
and when the quantity of the data description information in the target queue is larger than a first threshold value, the browser writes the target data description information into an alternative queue of the target limited server, wherein the data description information included in the alternative queue of the target limited server is set to be written back into the target queue when the quantity of the data description information included in the target queue is smaller than the first threshold value.
7. The method of claim 1, wherein before the browser sends the target data to the local server over the socket link, the method further comprises:
the browser detects the abnormity of the target data;
and when the detection result of the target data is abnormal, the browser intercepts the target data and generates an alarm message.
8. A data request system, comprising a local server and a browser, wherein:
the local server is used for acquiring a target service request, and the target service request carries a service identifier and target data description information; when the local server does not have target data corresponding to the target service request, determining an access address of a target limited server according to the service identifier, and sending the access address of the target limited server and the target data description information to a browser through a socket link;
the browser is used for generating a reference service request based on the access address of the target limited server and the target data description information and sending the reference service request to the target limited server; and acquiring target data from the target limited server, and sending the target data to the local server through the socket link, wherein the target data is data corresponding to the target data description information.
9. The system of claim 8, wherein the browser is configured to generate a reference service request based on the access address of the target restricted server and the target data description information, and comprises:
the browser is used for writing the target data description information into a target queue corresponding to the target limited server based on the access address of the target limited server; the data description information in the target queue is set to generate a reference service request according to a period and the access address of the target limited service terminal;
and when a target period is reached, taking out at least one piece of data description information including the target data description information from the target queue, and generating the reference service request based on the at least one piece of data description information and the access address of the target limited service terminal.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions for executing the data request method according to any one of claims 1-7, when the program instructions are executed by a processor.
CN202210059860.7A 2022-01-19 2022-01-19 Data request method, system and storage medium Pending CN114401307A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210059860.7A CN114401307A (en) 2022-01-19 2022-01-19 Data request method, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210059860.7A CN114401307A (en) 2022-01-19 2022-01-19 Data request method, system and storage medium

Publications (1)

Publication Number Publication Date
CN114401307A true CN114401307A (en) 2022-04-26

Family

ID=81229998

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210059860.7A Pending CN114401307A (en) 2022-01-19 2022-01-19 Data request method, system and storage medium

Country Status (1)

Country Link
CN (1) CN114401307A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103281366A (en) * 2013-05-21 2013-09-04 山东地纬计算机软件有限公司 Embedded agency monitoring device and method supporting real-time operating state acquiring
EP3110071A1 (en) * 2010-05-25 2016-12-28 Headwater Partners I LLC Device- assisted services for protecting network capacity
CN107426233A (en) * 2017-08-08 2017-12-01 深圳先进技术研究院 Data communication system, method, Web server and monitoring system based on B/S frameworks
CN107483972A (en) * 2017-07-24 2017-12-15 平安科技(深圳)有限公司 Live processing method, storage medium and a kind of mobile terminal of a kind of audio frequency and video
CN112434249A (en) * 2020-12-14 2021-03-02 杭州安恒信息安全技术有限公司 Browser webpage refreshing method, system and related device
CN113364795A (en) * 2021-06-18 2021-09-07 北京天空卫士网络安全技术有限公司 Data transmission method and proxy server
CN113704648A (en) * 2021-08-31 2021-11-26 平安普惠企业管理有限公司 Page data processing method, device, equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3110071A1 (en) * 2010-05-25 2016-12-28 Headwater Partners I LLC Device- assisted services for protecting network capacity
CN103281366A (en) * 2013-05-21 2013-09-04 山东地纬计算机软件有限公司 Embedded agency monitoring device and method supporting real-time operating state acquiring
CN107483972A (en) * 2017-07-24 2017-12-15 平安科技(深圳)有限公司 Live processing method, storage medium and a kind of mobile terminal of a kind of audio frequency and video
CN107426233A (en) * 2017-08-08 2017-12-01 深圳先进技术研究院 Data communication system, method, Web server and monitoring system based on B/S frameworks
CN112434249A (en) * 2020-12-14 2021-03-02 杭州安恒信息安全技术有限公司 Browser webpage refreshing method, system and related device
CN113364795A (en) * 2021-06-18 2021-09-07 北京天空卫士网络安全技术有限公司 Data transmission method and proxy server
CN113704648A (en) * 2021-08-31 2021-11-26 平安普惠企业管理有限公司 Page data processing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US9794365B2 (en) Re-establishing push notification channels via user identifiers
CN111124819B (en) Method and device for full link monitoring
US7793140B2 (en) Method and system for handling failover in a distributed environment that uses session affinity
CN108365971A (en) Daily record analytic method, equipment and computer-readable medium
CN104426985B (en) Show the method, apparatus and system of webpage
CN112162965B (en) Log data processing method, device, computer equipment and storage medium
CN107315646B (en) Method and device for controlling data flow between page components
CN107315972A (en) A kind of dynamic desensitization method of big data unstructured document and system
CN112905928B (en) Webpage refreshing method and device, electronic equipment and storage medium
CN113760674A (en) Information generation method and device, electronic equipment and computer readable medium
CN115039392A (en) Message processing method, device and system and server
US9507655B2 (en) Tracking asynchronous entry points for an application
CN109670100B (en) Page data capturing method and device
CN114153703A (en) Micro-service exception positioning method and device, electronic equipment and program product
CN109522501A (en) Content of pages management method and its device
US11811894B2 (en) Reduction of data transmissions based on end-user context
CN115811481A (en) Interactive service testing method and device, computer equipment and storage medium
CN116361584A (en) Page data processing method and device, computer equipment and storage medium
CN114401307A (en) Data request method, system and storage medium
CN114928638A (en) Network behavior analysis method and device and monitoring equipment
CN113704648A (en) Page data processing method, device, equipment and storage medium
CN109981738B (en) Cloud server suitable for application of narrow-band Internet of things
CN113703979A (en) Resource processing method and device, resource processing equipment and storage medium
CN115695587A (en) Service data processing system, method, device and storage medium
CN111327511A (en) Instant messaging method, system, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination