CN117194068A - Cross-process data transmission method, system, equipment and storage medium - Google Patents

Cross-process data transmission method, system, equipment and storage medium Download PDF

Info

Publication number
CN117194068A
CN117194068A CN202311065823.8A CN202311065823A CN117194068A CN 117194068 A CN117194068 A CN 117194068A CN 202311065823 A CN202311065823 A CN 202311065823A CN 117194068 A CN117194068 A CN 117194068A
Authority
CN
China
Prior art keywords
data transmission
data
request information
transmission request
inter
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
CN202311065823.8A
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.)
Ecarx Hubei Tech Co Ltd
Original Assignee
Ecarx Hubei Tech 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 Ecarx Hubei Tech Co Ltd filed Critical Ecarx Hubei Tech Co Ltd
Priority to CN202311065823.8A priority Critical patent/CN117194068A/en
Publication of CN117194068A publication Critical patent/CN117194068A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses a cross-process data transmission method, a system, equipment and a storage medium, which comprise the following steps: when receiving a data transmission instruction, the software application end generates data transmission request information according to the data transmission instruction and sends the data transmission request information to a local server through inter-process communication; the local server analyzes the data transmission request information, if the data transmission request information contains a preset data acquisition identifier, the local server is configured according to the data transmission request information, and the data transmission request information is sent to the data providing end; the data providing end returns the request data corresponding to the data transmission request information to the local server end, and the local server end returns the request data to the software application end through inter-process communication. Management authority is not required to be provided for the software application end, and independent three-party application is not required to be added, so that the logic of data cross-process transmission is simplified, and the stability of the software application in data calling is improved.

Description

Cross-process data transmission method, system, equipment and storage medium
Technical Field
The present invention relates to the field of data communications technologies, and in particular, to a cross-process data transmission method, system, device, and storage medium.
Background
The android operating system is mainly used in mobile equipment, such as a smart phone or a platform computer, and android software developed based on the android system is further applied to various industries.
Under some special use scenes, in consideration of security performance and the like, a target object to be accessed by the android software is moved into an isolated naming space, and only a local application entering a corresponding network naming space can access the target object by using a network, so that the android application cannot directly access the target object by using an HTTP protocol through an external network.
In the prior art, the android application itself is moved to the same name space as the target object by directly calling the core application program interface by the android software; or performing data transfer by setting other transfer terminals except the target object so as to finally realize the access of the android software to the target object. However, the android software management authority needs to be given under the condition of directly calling the core application program interface, so that a great potential safety hazard exists; and the data traffic of the Ethernet is doubled by carrying out transfer through other transfer terminals, so that the data transmission performance is reduced, and the access function of android software is directly affected under the condition that the transfer terminal fails, so that the requirement of software application stability is difficult to meet.
Disclosure of Invention
The invention provides a cross-process data transmission method, a system, equipment and a storage medium, which realize the data communication of a software application end and a data providing end which are isolated from each other through a local server end in the system, do not need to provide management rights for the software application end, do not need to add independent three-party applications, avoid security holes caused by the direct enhancement of rights of an application layer, realize the cross-process transmission of data under the condition of not needing more flow, simplify the logic of the data cross-process transmission, and promote the stability of the software application when data is called.
In a first aspect, an embodiment of the present invention provides a cross-process data transmission method, which is applied to a cross-process data transmission system, where the cross-process data transmission system includes a software application end, a local server end, and a data providing end; the software application end and the local server end can carry out inter-process communication; the method comprises the following steps:
when receiving a data transmission instruction, the software application end generates data transmission request information according to the data transmission instruction and sends the data transmission request information to a local server through inter-process communication;
the local server analyzes the data transmission request information, if the data transmission request information contains a preset data acquisition identifier, the local server is configured according to the data transmission request information, and the data transmission request information is sent to the data providing end;
The data providing end returns the request data corresponding to the data transmission request information to the local server end, and the local server end returns the request data to the software application end through inter-process communication.
In a second aspect, the embodiment of the invention also provides a cross-process data transmission system, which comprises a software application end, a local service end and a data providing end; the software application end and the local server end can carry out inter-process communication;
the software application end is used for generating data transmission request information according to the data transmission instruction when receiving the data transmission instruction, and sending the data transmission request information to the local server end through interprocess communication;
the local server is used for analyzing the data transmission request information, if the data transmission request information contains a preset data acquisition identifier, configuring the local server according to the data transmission request information, and sending the data transmission request information to the data providing end;
the data providing end is used for transmitting back the request data corresponding to the data transmission request information to the local server end, and the local server end transmits back the request data to the software application end through inter-process communication.
In a third aspect, an embodiment of the present invention further provides a cross-process data transmission apparatus, including:
At least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the cross-process data transmission method provided by any one of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions which, when executed by a computer processor, are used to perform the cross-process data transmission method provided by any of the embodiments of the present invention.
The embodiment of the invention provides a cross-process data transmission method, a system, equipment and a storage medium, wherein when a software application end receives a data transmission instruction, data transmission request information is generated according to the data transmission instruction, and the data transmission request information is sent to a local server end through inter-process communication; the local server analyzes the data transmission request information, if the data transmission request information contains a preset data acquisition identifier, the local server is configured according to the data transmission request information, and the data transmission request information is sent to the data providing end; the data providing end returns the request data corresponding to the data transmission request information to the local server end, and the local server end returns the request data to the software application end through inter-process communication. By adopting the technical scheme, before the cross-process data transmission is carried out, a cross-process data transmission system comprising a software application end, a local service end and a data providing end is constructed, through the local service end and an inter-process communication function arranged between the system, when the software application end receives a data transmission instruction, the data transmission request information can be sent to the data providing end when the data transmission request information is analyzed by the local service end and contains a preset data acquisition identifier, the data provided by the data providing end is further returned to the software application end needing the data through the local service end, the data transmission request transfer between the software application end and the data providing end which cannot be communicated is realized through the local service end and the inter-process communication technology built between the system without adding a third party application, the management authority is not required to be provided for the software application end, the security hole caused by the direct lifting of the authority of an application layer is not required to be increased, the cross-process transmission of the data is realized under the condition that more flow is not required, the logic of the data cross-process transmission is simplified, and the stability of the data transfer is improved when the software application is carried out.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a cross-process data transmission method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a cross-process data transmission method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a cross-process data transmission system according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a cross-process data transmission device according to a fourth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a schematic flow chart of a cross-process data transmission method provided in a first embodiment of the present invention, where the embodiment of the present invention is applicable to data communication between an application end and a server end that cannot be directly accessed through a real network address, so that data between the application end and the server end is cross-process transmitted. Alternatively, the cross-process data transmission device may be a notebook, a desktop computer, an intelligent tablet, or other devices with data computing functions, which is not limited in this embodiment of the present invention.
In the embodiment of the invention, the cross-process data transmission method can be applied to a cross-process data transmission system, wherein the cross-process data transmission system comprises a software application end, a local service end and a data providing end.
The software application end and the local server end can carry out inter-process communication.
In this embodiment, the software application may be specifically understood as an application program developed under an android or other systems and suitable for HTTP access, and optionally, the software application may be a Java application or other third party application program. The local server can be specifically understood as a server which is written out by a C++ or C code in the android system and is used for Java to carry out remote call, and the server is a program which is directly created in the system and can be automatically started along with the system start. The data provider may be understood as an application or a data storage module providing data support for the software application, and the web address of the data storage at the data provider may be considered as the real network address. The software application end may be android application software for video playing in the automobile data recorder, the data providing end may be an electronic controller in the automobile data recorder, the video data collected by the automobile data recorder may be stored in the electronic controller, if the video playing software wants to play the video collected by the automobile data recorder, the album in the electronic controller is required to be accessed, and the video data in the album is acquired for playing. Alternatively, the software application and the local server may communicate inter-process via Unix Domain Socket.
As shown in fig. 1, the cross-process data transmission method provided by the embodiment of the invention specifically includes the following steps:
s101, when receiving a data transmission instruction, the software application terminal generates data transmission request information according to the data transmission instruction and sends the data transmission request information to a local server terminal through inter-process communication.
In this embodiment, the data transmission instruction is specifically understood as an instruction inputted from the outside for determining whether data transmission is required or controlling the start and stop of data transmission. The data transmission request information may be specifically understood as generated after the localization processing of the real network address, and includes the required real network address information and other information for determining whether the data transmission is required.
Specifically, when receiving a data transmission instruction, the software application terminal judges the specific type of the data transmission instruction, processes the real network address aiming at the instruction needing to carry out data transmission so as to be suitable for interprocess communication with the local server terminal, synthesizes the processed network address and information used for representing the data transmission need to generate data transmission request information, and then sends the data transmission request information to the local server terminal through interprocess communication by the software application terminal. Aiming at the instruction of stopping data transmission, the software application end generates data transmission request information for representing the information of stopping data transmission, and then the software application end sends the data transmission request information to the local server end through inter-process communication.
S102, the local server analyzes the data transmission request information, if the data transmission request information contains a preset data acquisition identifier, the local server is configured according to the data transmission request information, and the data transmission request information is sent to the data providing end.
In this embodiment, the preset data acquisition identifier may be specifically understood as preset identification information for characterizing that the software application end needs the data providing end to perform the data providing requirement.
Specifically, after receiving the data transmission request information through inter-process communication, the local server analyzes the data transmission request information, and if the prefix part of the field obtained after analysis contains a preset data acquisition identifier, the data transmission request information can be considered as information for requesting data from the data providing end, and the data transmission request information needs to be forwarded by the local server. Because the local server is a server playing a role in forwarding, in order to better interface with the data providing end under the real network address, the local server needs to be configured according to the real network address contained in the data transmission request information, and the configured local server sends the data transmission request information to the data providing end.
In the embodiment of the invention, the local server which can communicate with the software application end between local processes is directly constructed in the system, so that the software application end and the data providing end which cannot be directly accessed by the real network address are communicated through the local server, an external server is not required to be introduced, the data flow consumption in the data transmission process is reduced, and the data transmission safety and the data transmission efficiency are improved.
S103, the data providing end returns the request data corresponding to the data transmission request information to the local server end, and the local server end returns the request data to the software application end through inter-process communication.
Specifically, after receiving the data transmission request, the data providing end returns the request data corresponding to the data transmission request to the local server end, and further returns the request data to the software application end through inter-process communication between the local server end and the software application end, so that the software application end can realize the transmission and the call of the data in the data providing end which cannot be directly accessed.
According to the technical scheme, when a software application end receives a data transmission instruction, data transmission request information is generated according to the data transmission instruction, and the data transmission request information is sent to a local server end through inter-process communication; the local server analyzes the data transmission request information, if the data transmission request information contains a preset data acquisition identifier, the local server is configured according to the data transmission request information, and the data transmission request information is sent to the data providing end; the data providing end returns the request data corresponding to the data transmission request information to the local server end, and the local server end returns the request data to the software application end through inter-process communication. By adopting the technical scheme, before the cross-process data transmission is carried out, a cross-process data transmission system comprising a software application end, a local service end and a data providing end is constructed, through the local service end and an inter-process communication function arranged between the system, when the software application end receives a data transmission instruction, the data transmission request information can be sent to the data providing end when the data transmission request information is analyzed by the local service end and contains a preset data acquisition identifier, the data provided by the data providing end is further returned to the software application end needing the data through the local service end, the data transmission request transfer between the software application end and the data providing end which cannot be communicated is realized through the local service end and the inter-process communication technology built between the system without adding a third party application, the management authority is not required to be provided for the software application end, the security hole caused by the direct lifting of the authority of an application layer is not required to be increased, the cross-process transmission of the data is realized under the condition that more flow is not required, the logic of the data cross-process transmission is simplified, and the stability of the data transfer is improved when the software application is carried out.
Example two
Fig. 2 is a flowchart of a cross-process data transmission method provided by a second embodiment of the present invention, where the technical solution of the embodiment of the present invention is further optimized based on the above-mentioned alternative technical solutions, and by penetrating an inter-process communication server and an inter-process communication client in a local server and a software application, respectively, before a software application receives a data transmission instruction, and constructing a communication connection between the inter-process communication server and the inter-process communication client, so as to implement communication between the software application and the local server. Meanwhile, a local proxy server is established in the software application end, so that the local proxy server is suitable for transmitting a real network address to the local server, when the software application end receives a data transmission instruction, the address configuration of the data transmission port and the generation of data transmission request information for requesting data are completed or the generation of the data transmission request information for stopping data transmission is completed according to the instruction type of the data transmission instruction, the software application end and the local server can perform proper address configuration when data transmission is required, resource release can be completed as soon as possible when data transmission is not performed, the efficiency and the stability of data transmission across processes are improved, the logic of data transmission across processes is simplified, and the stability of software application when data call is performed is improved.
As shown in fig. 2, the cross-process data transmission method provided by the embodiment of the invention specifically includes the following steps:
s201, an inter-process communication server is created in a local server according to a preset inter-process communication name.
In this embodiment, the preset interprocess communication name may be specifically understood as a name preset according to actual situations, which is used to perform personalized identity representation on the constructed interprocess communication (Unix Domain Socket, UDS). For example, assuming that media data is acquired and played, that is, the data requirement corresponding to the software application end is provided by the MediaPlayer, the inter-process communication name may be set to "MediaPlayerUDS", or the corresponding inter-process communication name may be preset according to the actual situation, which is not limited in the embodiment of the present invention.
Specifically, before the cross-process data transmission system is put into use, a local server Native Service can be pulled up locally in the system, then an inter-process communication Service end LocalServerSocket supporting UDS in android Native is created by taking a preset inter-process communication name as a parameter at the local server, and then an accept method of the LocalServerSocket can be called in a sub-thread, and connection of a client corresponding to the inter-process communication Service end is waited in a blocking mode.
S202, creating an inter-process communication client in the software application according to the preset inter-process communication name.
Specifically, before the cross-process data transmission system is put into use, and after the inter-process communication server is established in the local server, an inter-process communication client LocalSocket supporting UDS in the android native manner can be correspondingly established in the software application according to a preset inter-process communication name which is the same as the name of the inter-process communication server.
S203, the software application end determines a socket address according to the preset inter-process communication name and the preset address creation instruction, and transmits the socket address to the inter-process communication client end so as to complete communication connection between the inter-process communication client end and the inter-process communication server end.
Specifically, after the software application end completes the creation of the inter-process communication client, as the inter-process communication client and the inter-process communication server have the same preset inter-process communication name, the corresponding relationship between the inter-process communication client and the inter-process communication server can be built according to the pre-process communication name, and further, the software application end can use a preset address creation instruction preset in an android system as parameters to create a socket address under a Unix domain socket abstract namespace supporting USD, and further, the socket address is transferred to the inter-process communication client, so that the inter-process communication client can call a corresponding connet method by taking the socket address as the parameters, and the communication connection between the inter-process communication client and the inter-process communication server is completed. Alternatively, wherein the preset address creation instruction may be
The created socket address may be denoted LocalSocketAdress.
S204, creating a local proxy server in the software application.
In this embodiment, the home agent server may be specifically understood as a socket that is established locally and adapted to a local network address, and is used to monitor a client that needs to request data, and may be connected to other servers.
Specifically, in order to perform data request and data transmission when the local proxy needs to perform the request from the real network address, the server socket under the local HTTP protocol needs to be set up at the software application end, and the created server socket is determined as the local proxy server.
S205, binding the local proxy server to preset local domain name and preset idle port number.
In this embodiment, the preset local domain name may be specifically understood as a domain name of a preset local network IP address. The preset idle port number may be specifically understood as a preset idle port number.
For example, assuming that the local IP address is "127.0.0.1" and the preset idle port number is 9090, the constructed local proxy server may be bound to the local IP address and the preset idle port number, and further may block a data transmission request of the MediaPlayer that provides the data requirement by calling the accept method of ServerSocket in the sub-thread.
S206, generating a local network address according to the preset local domain name, the preset idle port number and the preset real network address.
In this embodiment, presetting the real network address can be understood specifically as pre-configuring according to the call requirement of the software application, and storing the real network address of the data to be called in the data providing terminal.
In view of the above, it is assumed that in the usage scenario of the automobile data recorder, the software application end is video playing software that needs to acquire video data, the preset REAL network address is the address of the album in the electronic controller, which may be represented as dvr_real_mp4_path, and then the domain name in the preset REAL network address may be replaced by the preset local domain name "127.0.0.1", and the port number of the preset REAL network address may be replaced by the preset idle port number 9090 used by the local proxy server.
S207, initializing the data transmission port, and monitoring the initialized data transmission port by the local proxy server.
Specifically, after the construction for the inter-process communication between the software application end and the local server end is completed, and the configuration of the local proxy server end is performed, the software application end can be considered to be used for receiving a request for a data transmission port giving a data transmission requirement, and performing subsequent processing for the data transmission request. At this time, the data transmission port in the software application end for externally receiving the data transmission instruction can be initialized to complete the preparation of cross-process data transmission, and the initialized data transmission port can be monitored by the local proxy server end, so that the local proxy server end can timely acquire the data transmission instruction input by the data transmission port.
In the above example, assuming that in the usage scenario of the automobile data recorder, the software application end is video playing software that needs to acquire video data, the data transmission port of the software application end may be considered as an SDK port related to MediaPlayer, after the construction of inter-process communication between the software application end and the local server end is completed, and after the configuration of the local proxy server end, callback interception of the player onPrepared may be set by invoking the setonpreparedlist method of the MediaPlayer, so as to further realize interception of the data transmission instruction input in the data transmission port by the local proxy server end.
S208, when the software application receives a data transmission instruction input by the data transmission port, if the instruction type of the data transmission instruction is a request type, executing S209; if the instruction type of the data transfer instruction is a stop type, S215 is performed.
Specifically, when the software application end receives the input data transmission instruction through the data transmission port, the software application end may be considered to have a requirement of performing data call or stopping data call, at this time, the instruction type of the data transmission instruction may be analyzed, if the instruction type is a request type, the software application end may be considered to be required to complete the cross-process data call to the data providing end through the local server end, at this time, step S209 is executed; if the instruction type is the stop type, the software application may consider that the execution of the cross-process data call from the local server to the data provider needs to be stopped, and step S215 is performed.
S209, setting a local network address for the data transmission port.
Specifically, after determining that software corresponding to the data transmission port needs to call and transmit data, in order to meet the local communication requirement, a software application end sets a predetermined local network address for the data transmission port.
With the above example, the software application may call the setDataSource method of the MediaPlayer corresponding to the data transmission port by using the generated local network address as a parameter, and then call the preplay method of the MediaPlayer, to trigger the initialized MediaPlayer to issue the data transmission request, so that the data transmission request may be monitored by the local proxy server corresponding to the local network address via the data transmission port.
And S210, when the local proxy server monitors a local data transmission request, updating the local data transmission request through presetting a real network domain name, presetting a real port number and presetting a data acquisition identifier, determining the updated local data transmission request as data transmission request information, and sending the data transmission request information to the interprocess communication client.
In this embodiment, the local data transmission request is specifically understood as a request issued by software with a data transmission requirement via a data transmission port for requesting a data call after initialization and local network address configuration are completed.
Specifically, when the local proxy server monitors the local data transmission request, it can be considered that the service accessing the software application through the data transmission port has a data transmission requirement, and when the local proxy server needs to send the local data transmission request to the local server and further send the data request to the data providing terminal with the real address through the local server, the information related to the real network address needs to be carried in the information sent to the local server, so that the local proxy server can update the local data transmission request through the preset real network domain name and the preset real port number corresponding to the preset real network address, and meanwhile, in order to make the local server definitely whether to perform data acquisition according to the data transmission request information input into the local proxy server, a preset data acquisition identifier for representing that data acquisition is required to be added in the updated local data transmission request, the local data transmission request with all the updates and the information added is determined as the data transmission request information, and the local proxy server sends the data transmission request information to the client of the software application.
In this way, when the local proxy server socket obtains the local data transmission request transmitted by the MediaPlayer through the data transmission port, the local network domain name and the port number in the local data transmission request are replaced by the network domain name and the port number in the real preset real network address, so as to generate the information of the data transmission request for the real network, and meanwhile, a preset data acquisition identifier, such as 'real_socket_request', is added in the previous year of the request information, the added request information is determined as the data transmission request information, and the data transmission request information is sent to the inter-process communication client LocalSocket.
S211, the inter-process communication client sends the data transmission request information to the inter-process communication server.
S212, the local server analyzes the data transmission request information, and if the data transmission request information contains a preset data acquisition identifier, the data transmission end is established at the local server according to a preset real network domain name and a preset real port number in the data transmission request information.
Specifically, the local server analyzes the data transmission request information when receiving the data transmission request information, if the data transmission request information after analysis contains the preset data acquisition identifier, the data transmission request information can be considered as request information for hopefully accessing the data providing end and acquiring feedback data, at this time, a data transmission end for accessing the data providing end can be created in the local server, and the data transmission end is configured through the preset real network domain name and the preset real port number in the data transmission request information, so that the data transmission end can directly perform data transmission with the data providing end with the real address after configuration.
In this way, after receiving the data transmission request information through the inter-process communication server LocalServerSocket, the local server Native Service analyzes the data transmission request information to determine whether the data transmission request information starts with the preset data acquisition identifier, if yes, a Socket is created in the local server Native Service as the data transmission end, and then the connection between the data transmission end and the data providing end is completed according to the preset real network domain name and the preset real port number in the data transmission request information, and then the data transmission request information received by the inter-process communication server LocalServerSocket is transferred to the data providing end.
S213, the data transmission end sends the data transmission request information to the data providing end.
And S214, the data providing end returns the request data corresponding to the data transmission request information to the local server end, and the local server end returns the request data to the software application end through inter-process communication.
Specifically, after receiving the data transmission request information, the data providing end provides corresponding request data according to the data transmission request information, and as the data providing end is connected with the data transmission end in the local server, the request data can be transmitted back to the data transmission end through the connection, and then the data transmission end transmits the request data to the inter-process communication server, so that the inter-process communication server can transmit the request data received by the local server back to the inter-process communication client of the software application end according to the communication connection between the inter-process communication server and the inter-process communication client, and further the request data is transmitted to a data transmission port with data transmission requirements through the local proxy server in the software application end, and the transmission and the call of the data are completed.
S215, generating data transmission request information containing a preset data release identifier.
Specifically, when the software application determines that the received data transmission instruction is of a stop type, the software application may consider that the software application needs to stop the cross-process data transmission provided by the local server. In order to make the local server end definitely whether to acquire data according to the data transmission request information input into the local server end, at this time, data transmission request information containing a preset data release identifier for representing that data acquisition needs to be stopped can be generated.
By way of example, the preset data release identifier may be denoted as "stop_socket_request", which is not limited in the embodiment of the present invention.
S216, the inter-process communication client sends the data transmission request information to the inter-process communication server, and releases the resources of the inter-process communication client.
Specifically, the software application terminal sends the data transmission request information containing the preset data release identifier to the local server terminal through the inter-process communication client terminal, and meanwhile, the software application terminal definitely needs to stop acquiring the data after receiving the data transmission instruction, so that the resources of the inter-process communication client terminal can be released, and the consumption of the memory is reduced.
S217, the local server analyzes the data transmission request information, and if the data transmission request information contains a preset data release identifier, the resources of the inter-process communication server are released.
Specifically, the local server analyzes the data transmission request information when receiving the data transmission request information, if the data transmission request information is determined to contain a preset data release identifier after analysis, the data transmission request information can be considered as request information for hopefully stopping acquiring data from the data providing end and releasing resources in the local server, at the moment, the data transmission end can stop receiving the data of the data providing end, and simultaneously, the resources of the inter-process communication server are released.
According to the technical scheme, before the software application end receives the data transmission instruction, the inter-process communication server end and the inter-process communication client end are respectively penetrated in the local server end and the software application end, communication connection between the inter-process communication server end and the inter-process communication client end is constructed, and communication between the software application end and the local server end is achieved. Meanwhile, a local proxy server is established in the software application end, so that the local proxy server is suitable for transmitting a real network address to the local server, when the software application end receives a data transmission instruction, the address configuration of the data transmission port and the generation of data transmission request information for requesting data are completed or the generation of the data transmission request information for stopping data transmission is completed according to the instruction type of the data transmission instruction, the software application end and the local server can perform proper address configuration when data transmission is required, resource release can be completed as soon as possible when data transmission is not performed, the efficiency and the stability of data transmission across processes are improved, the logic of data transmission across processes is simplified, and the stability of software application when data call is performed is improved.
Example III
Fig. 3 is a schematic structural diagram of a cross-process data transmission system according to a third embodiment of the present invention, and as shown in fig. 3, the cross-process data transmission system 1 includes: a software application 11, a local server 12 and a data provider 13. Wherein, the software application 11 and the local server 12 can perform inter-process communication.
The software application 11 is configured to generate data transmission request information according to the data transmission instruction when receiving the data transmission instruction, and send the data transmission request information to the local server 12 through inter-process communication;
the local server 12 is configured to parse the data transmission request information, configure the local server 12 according to the data transmission request information if the data transmission request information includes a preset data acquisition identifier, and send the data transmission request information to the data providing end 13;
the data providing end 13 is configured to transmit back the request data corresponding to the data transmission request information to the local server 12, and the local server 12 transmits back the request data to the software application 11 through inter-process communication.
According to the technical scheme, before cross-process data transmission is carried out, a cross-process data transmission system comprising a software application end, a local service end and a data providing end is constructed, through the local service end and an inter-process communication function arranged between the system and the data providing end, when the software application end receives a data transmission instruction, data transmission request information can be analyzed through the local service end, the data transmission request information is sent to the data providing end when preset data acquisition identifiers are contained in the data transmission request information, the data provided by the data providing end is returned to the software application end needing the data through the local service end, under the condition that a third party application is not required to be independently added, data transmission requests between the software application end and the data providing end which cannot be communicated are transferred through the local service end and the inter-process communication technology built between the system, management rights are not required to be provided for the software application end, security holes caused by direct lifting rights of an application layer are not required to be increased, data cross-process transmission is achieved under the condition that more traffic is not required, logic of data cross-process transmission is simplified, and stability of data transfer is improved when software application is carried out.
Optionally, the software application 11 includes: a data transmission port 110, a home agent server 111, and an interprocess communication client 112. The local server 12 includes: the interprocess communication server 120.
The inter-process communication server 120 is created in the local server 12 according to a preset inter-process communication name; the interprocess communication client 112 is created in the software application 11 according to a preset interprocess communication name.
The software application 11 is specifically configured to:
determining a socket address according to a preset inter-process communication name and a preset address creation instruction, and transmitting the socket address to the inter-process communication client 112 to complete communication connection between the inter-process communication client 112 and the inter-process communication server 120;
binding the home agent server 111 to a preset home domain name and a preset idle port number;
generating a local network address according to a preset local domain name, a preset idle port number and a preset real network address;
the data transmission port 110 is initialized, and the initialized data transmission port 110 is monitored by the home agent server 111.
Optionally, when the software application 11 receives a data transmission instruction input by the data transmission port 110, if the instruction type of the data transmission instruction is a request type, a local network address is set for the data transmission port 110;
When the local proxy server 111 monitors a local data transmission request, updating the local data transmission request through presetting a real network domain name, presetting a real port number and presetting a data acquisition identifier, determining the updated local data transmission request as data transmission request information, and sending the data transmission request information to the interprocess communication client 112;
the inter-process communication client 112 transmits the data transmission request information to the inter-process communication server 120.
Optionally, configuring the local server 12 according to the data transmission request information and sending the data transmission request information to the data providing end 13 includes:
creating a data transmission end 121 at the local server 12 according to the preset real network domain name and the preset real port number in the data transmission request information;
the data transmission terminal 121 transmits the data transmission request information to the data providing terminal 13.
Optionally, when the software application 11 receives a data transmission instruction input by the data transmission port 110, if the instruction type of the data transmission instruction is a stop type, data transmission request information including a preset data release identifier is generated;
the inter-process communication client 112 transmits the data transmission request information to the inter-process communication server 120, and releases the resources of the inter-process communication client 112.
The local server 12 parses the data transmission request information, and if the data transmission request information includes a preset data release identifier, releases the resource of the inter-process communication server 120.
The cross-process data transmission system provided by the embodiment of the invention can execute the cross-process data transmission method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 is a schematic structural diagram of a cross-process data transmission device according to a fourth embodiment of the present invention. The cross-process data transmission device 40 may be an electronic device intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the cross-process data transmission device 40 includes at least one processor 41, and a memory, such as a Read Only Memory (ROM) 42, a Random Access Memory (RAM) 43, etc., communicatively connected to the at least one processor 41, in which the memory stores computer programs executable by the at least one processor, and the processor 41 may perform various suitable actions and processes according to the computer programs stored in the Read Only Memory (ROM) 42 or the computer programs loaded from the storage unit 48 into the Random Access Memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the cross-process data transfer device 40 may also be stored. The processor 41, the ROM 42 and the RAM 43 are connected to each other via a bus 44. An input/output (I/O) interface 45 is also connected to bus 44.
The various components in the cross-process data transfer device 40 are connected to the I/O interface 45, including: an input unit 46 such as a keyboard, a mouse, etc.; an output unit 47 such as various types of displays, speakers, and the like; a storage unit 48 such as a magnetic disk, an optical disk, or the like; and a communication unit 49 such as a network card, modem, wireless communication transceiver, etc. The communication unit 49 allows the cross-process data transmission device 40 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 41 may be various general and/or special purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 41 performs the various methods and processes described above, such as the cross-process data transfer method.
In some embodiments, the cross-process data transmission method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 48. In some embodiments, part or all of the computer program may be loaded and/or installed onto the cross-process data transmission device 40 via the ROM 42 and/or the communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more of the steps of the cross-process data transfer method described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to perform the cross-process data transmission method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. The cross-process data transmission method is characterized by being applied to a cross-process data transmission system, wherein the cross-process data transmission system comprises a software application end, a local service end and a data providing end; the software application end and the local server end can carry out inter-process communication; the method comprises the following steps:
when receiving a data transmission instruction, the software application terminal generates data transmission request information according to the data transmission instruction, and sends the data transmission request information to the local server terminal through inter-process communication;
The local server analyzes the data transmission request information, if the data transmission request information contains a preset data acquisition identifier, the local server is configured according to the data transmission request information, and the data transmission request information is sent to the data providing end;
the data providing end returns the request data corresponding to the data transmission request information to the local server end, and the local server end returns the request data to the software application end through inter-process communication.
2. The method of claim 1, further comprising, before the software application receives the data transmission instruction:
establishing an inter-process communication server in the local server according to a preset inter-process communication name;
creating an inter-process communication client in the software application according to the preset inter-process communication name;
and the software application end determines a socket address according to the preset inter-process communication name and the preset address creation instruction, and transmits the socket address to the inter-process communication client end so as to complete communication connection between the inter-process communication client end and the inter-process communication server end.
3. The method of claim 2, further comprising, after said completing the communication connection of the inter-process communication client and the inter-process communication server:
creating a local proxy server in the software application;
binding the local proxy server to preset local domain names and preset idle port numbers;
generating a local network address according to the preset local domain name, the preset idle port number and a preset real network address;
initializing a data transmission port, and monitoring the initialized data transmission port by the local proxy server.
4. The method according to claim 3, wherein the software application, when receiving the data transmission instruction, generates data transmission request information according to the data transmission instruction, and sends the data transmission request information to the local server through inter-process communication, including:
when the software application receives a data transmission instruction input by the data transmission port, if the instruction type of the data transmission instruction is a request type, setting the local network address for the data transmission port;
When the local proxy server monitors a local data transmission request, updating the local data transmission request through presetting a real network domain name, a real port number and a data acquisition identifier, determining the updated local data transmission request as data transmission request information, and sending the data transmission request information to the interprocess communication client;
and the inter-process communication client sends the data transmission request information to the inter-process communication server.
5. The method of claim 4, wherein configuring the local server according to the data transmission request information and transmitting the data transmission request information to the data provider comprises:
creating a data transmission end at the local server according to the preset real network domain name and the preset real port number in the data transmission request information;
the data transmission end sends the data transmission request information to the data providing end.
6. The method according to claim 3, wherein the software application, when receiving the data transmission instruction, generates data transmission request information according to the data transmission instruction, and sends the data transmission request information to the local server through inter-process communication, including:
When the software application receives a data transmission instruction input by the data transmission port, if the instruction type of the data transmission instruction is a stop type, generating data transmission request information containing a preset data release identifier;
and the inter-process communication client sends the data transmission request information to the inter-process communication server and releases the resources of the inter-process communication client.
7. The method according to claim 6, further comprising, after the local server parses the data transmission request information:
and if the data transmission request information contains the preset data release identifier, releasing the resources of the inter-process communication server.
8. The cross-process data transmission system is characterized by comprising a software application end, a local service end and a data providing end; the software application end and the local server end can carry out inter-process communication;
the software application end is used for generating data transmission request information according to the data transmission instruction when receiving the data transmission instruction, and sending the data transmission request information to the local server end through inter-process communication;
The local server is configured to parse the data transmission request information, if the data transmission request information includes a preset data acquisition identifier, configure the local server according to the data transmission request information, and send the data transmission request information to the data providing end;
the data providing end is used for transmitting back the request data corresponding to the data transmission request information to the local server end, and the local server end transmits back the request data to the software application end through inter-process communication.
9. A cross-process data transmission apparatus, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the cross-process data transmission method of any one of claims 1-7.
10. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the cross-process data transmission method of any of claims 1-7.
CN202311065823.8A 2023-08-22 2023-08-22 Cross-process data transmission method, system, equipment and storage medium Pending CN117194068A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311065823.8A CN117194068A (en) 2023-08-22 2023-08-22 Cross-process data transmission method, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311065823.8A CN117194068A (en) 2023-08-22 2023-08-22 Cross-process data transmission method, system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117194068A true CN117194068A (en) 2023-12-08

Family

ID=88986142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311065823.8A Pending CN117194068A (en) 2023-08-22 2023-08-22 Cross-process data transmission method, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117194068A (en)

Similar Documents

Publication Publication Date Title
KR20170022996A (en) Integrated apis and uis for consuming services across different distributed networks
CN110399578B (en) Page access method and device
CN109918191B (en) Method and device for preventing frequency of service request
US10908970B1 (en) Data interface for secure analytic data system integration
US20220365801A1 (en) Cloud shell extension framework
CN112202744B (en) Multi-system data communication method and device
CN114124929A (en) Cross-network data processing method and device
CN112835632B (en) Method and equipment for calling end capability and computer storage medium
EP3387816B1 (en) Connecting and retrieving security tokens based on context
US10958726B2 (en) Method of synchronizing device list in a smart network system, apparatus, and computer storage medium thereof
CN113010238A (en) Permission determination method, device and system for micro application call interface
CN110120963B (en) Data processing method, device, equipment and machine readable medium
CN113612643B (en) Network configuration method, device and equipment of cloud mobile phone and storage medium
CN115629909A (en) Service data processing method and device, electronic equipment and storage medium
CN115941766A (en) Operation and maintenance data processing method and device
CN115550413A (en) Data calling method and device, service gateway and storage medium
CN117194068A (en) Cross-process data transmission method, system, equipment and storage medium
CN113760487B (en) Service processing method and device
CN112929453A (en) Method and device for sharing session data
CN114095758B (en) Cloud image intercepting method and related device
CN116361771B (en) Method and device for accessing and managing equipment, electronic equipment and storage medium
CN110198266B (en) Real-time data stream processing method and system
CN117556116A (en) Method and device for processing request information, electronic equipment and storage medium
CN115080229A (en) Resource object management method and device
CN117234751A (en) Cross-partition process communication method and device, electronic equipment and storage medium

Legal Events

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