CN117240913B - Proxy communication method, test system, terminal device and storage medium - Google Patents

Proxy communication method, test system, terminal device and storage medium Download PDF

Info

Publication number
CN117240913B
CN117240913B CN202311499893.4A CN202311499893A CN117240913B CN 117240913 B CN117240913 B CN 117240913B CN 202311499893 A CN202311499893 A CN 202311499893A CN 117240913 B CN117240913 B CN 117240913B
Authority
CN
China
Prior art keywords
communication
proxy service
server
thread
test equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311499893.4A
Other languages
Chinese (zh)
Other versions
CN117240913A (en
Inventor
樊晓婷
钟荣钊
余洪波
罗展昭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Jingshi Technology Co ltd
Original Assignee
Shenzhen Jingshi 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 Shenzhen Jingshi Technology Co ltd filed Critical Shenzhen Jingshi Technology Co ltd
Priority to CN202311499893.4A priority Critical patent/CN117240913B/en
Publication of CN117240913A publication Critical patent/CN117240913A/en
Application granted granted Critical
Publication of CN117240913B publication Critical patent/CN117240913B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to the field of communication, and discloses a proxy communication method, a test system, terminal equipment and a storage medium, wherein the method comprises the following steps: determining a current communication mode according to the input communication parameters, and establishing a first communication proxy service; the communication parameters comprise unique connection identifiers of the test equipment; if the communication mode is internet communication, establishing communication connection with a server through the first communication proxy service, matching the server with test equipment through the unique connection identifier, and establishing communication connection with the test equipment through the server; and if the communication mode is local area network communication, establishing communication connection with the test equipment through the first communication proxy service. Different communication requirements of the upper computer are completed through the communication proxy service, maintenance of communication functions is simplified, communication modes are unified, and a communication process is easier to track.

Description

Proxy communication method, test system, terminal device and storage medium
Technical Field
The present invention relates to the field of communications, and in particular, to a proxy communication method, a test system, a terminal device, and a storage medium.
Background
In a system for testing products, it is often required to have a function of testing a device for local area network communication and a device for internet communication. The content of the test items is the same (for example, the camera equipment product test comprises a video test item, an audio test item, an IRCut test item and a reset key test item), the communication instruction is the same, and the communication logic is quite different. Distinction of communication modes between local area networks and the internet: the local area network PC end communicates with the equipment end: the PC end is used as a Socket TCP client end, the equipment end is used as a Socket TCP guest server end, the equipment end firstly binds a local IP opening port to monitor and wait for the PC end to actively throw connection, and the product test related instruction communication can be carried out after successful connection. The internet PC end communicates with the equipment end: the server is used as a Socket TCP server, and the PC and the device are used as clients. The server end binds the local IP opening port first, monitors and waits for the PC end to be connected with the equipment end in an active throwing mode, and after successful connection, the PC end and the equipment end are matched to carry out product test related instruction communication. Because the PC end and the equipment end can independently make different versions of software corresponding to different communication modes, the development cost is increased; and the subsequent continuous updating function is realized, and the software of the PC end and the software of the equipment end of the two versions are updated together, so that the maintenance cost is greatly increased.
Disclosure of Invention
In a first aspect, the present application provides a proxy communication method, applied to a host computer, where the method includes:
determining a current communication mode according to the input communication parameters, and establishing a first communication proxy service; the communication parameters comprise unique connection identifiers of the test equipment;
if the communication mode is internet communication, establishing communication connection with a server through the first communication proxy service, matching the server with test equipment through the unique connection identifier, and establishing communication connection with the test equipment through the server;
and if the communication mode is local area network communication, establishing communication connection with the test equipment through the first communication proxy service.
Further, the determining the current communication mode according to the input communication parameters includes:
and if the communication parameters comprise the unique connection identifier of the test equipment, the communication mode is the Internet communication, and if the communication parameters comprise the IP address and the port number of the test equipment, the communication mode is the local area network communication.
Further, if the communication mode is lan communication, after establishing a communication connection with the test device through the first communication proxy service, the method further includes:
the first communication proxy service synchronously starts a first thread and a second thread;
the first thread is used for taking the first communication proxy service as a client to monitor whether the test equipment has data transmission or not, and if so, the first communication proxy service is used as a server to transmit the transmitted data to the upper computer equipment;
the second thread is used for taking the first communication proxy service as a server to monitor whether the upper computer has data to be transmitted out, and if so, the first communication proxy service is transmitted to the test equipment by taking the first communication proxy service as a client.
Further, if the communication mode is internet communication, after establishing communication connection with the server through the first communication proxy service, the method further includes:
the first communication proxy service synchronously starts a first thread and a second thread;
the first thread is used for taking the first communication proxy service as a client to monitor whether the server has data transmission or not, and if so, the first communication proxy service is used as a server to transmit the transmitted data to the upper computer equipment;
the second thread is used for taking the first communication proxy service as a server to monitor whether the upper computer has data to be transmitted out or not, and if so, the first communication proxy service is transmitted to the server by taking the first communication proxy service as a client.
In a second aspect, the present application further provides a proxy communication method, applied to a test device, including:
determining a current communication mode according to the input communication parameters, and establishing a second communication proxy service;
if the communication mode is internet communication, establishing communication connection with a server through the second communication proxy service, sending a unique connection identifier of the server, and establishing communication connection with an upper computer matched with the unique connection identifier;
if the communication mode is local area network communication, communication connection is established between the second communication proxy service and the upper computer.
Further, if the communication mode is internet communication, after establishing communication connection with the server through the second communication proxy service, the method further includes:
the second communication proxy service synchronously starts a third thread and a fourth thread;
the third thread is used for taking the second communication proxy service as a client to monitor the data from the server, determining whether the data is transmitted, if so, taking the second communication proxy service as a server, and transmitting the transmitted data into the test equipment;
the fourth thread is configured to monitor, by using the second communication proxy service as a server, whether the test device has data outgoing, and if so, transmit, by using the second communication proxy service as a client, the data to be transmitted to a server.
Further, if the communication mode is lan communication, after establishing communication connection with the upper computer through the second communication proxy service, the method further includes:
the second communication proxy service synchronously starts a third thread and a fourth thread;
the third thread is used for taking the second communication proxy service as a client to monitor the data from the server, determining whether the data is transmitted or not, if yes, taking the second communication proxy service as a server, and transmitting the transmitted data into the test equipment;
the fourth thread is configured to monitor, by using the second communication proxy service as a server, whether the test device has data outgoing, and if so, transmit, by using the second communication proxy service as a client, the data to be transmitted to a server.
Third aspect the present application provides a test system comprising: the system comprises an upper computer, test equipment and a server;
the upper computer determines a current communication mode according to communication parameters transmitted by the upper computer and establishes a first communication proxy service;
if the communication mode of the upper computer is internet communication, establishing communication connection with the server through the first communication proxy service, matching the server with the test equipment through the unique connection identifier of the test equipment, and establishing communication connection with the test equipment through the server;
if the communication mode of the upper computer is local area network communication, establishing communication connection with the test equipment through the first communication proxy service;
the test equipment determines a current communication mode according to the input communication parameters and establishes a second communication proxy service;
if the communication mode of the test equipment is Internet communication, establishing communication connection with a server through the second communication proxy service, sending a unique connection identifier of the test equipment to the server, and establishing communication connection with an upper computer matched with the unique connection identifier;
if the communication mode of the test equipment is local area network communication, communication connection is established between the second communication proxy service and the upper computer.
Fourth aspect the present application provides a terminal device comprising a processor and a memory, said memory storing a computer program which, when run on said processor, performs said proxy communication method.
Fifth aspect the present application provides a readable storage medium storing a computer program which when run on a processor performs the proxy communication method.
The invention discloses a proxy communication method, a testing system, terminal equipment and a storage medium, wherein the method comprises the following steps: determining a current communication mode according to the input communication parameters, and establishing a first communication proxy service; if the communication mode is internet communication, establishing communication connection with a server through the first communication proxy service, matching the server with the test equipment through a unique connection identifier of the test equipment, and establishing communication connection with the test equipment through the server; and if the communication mode is local area network communication, establishing communication connection with the test equipment through the first communication proxy service. The communication proxy service is used for completing different communication requirements of the upper computer, so that maintenance of communication functions is simplified, communication modes are unified, communication processes are easier to track, development maintenance pressure is reduced, communication methods are unified and completed by respective proxies, problems in communication are easier to locate during testing, and testing efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention, the drawings that are required for the embodiments will be briefly described, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope of the present invention. Like elements are numbered alike in the various figures.
FIG. 1 is a schematic diagram of a test system according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a proxy communication method of an upper computer in a test system according to an embodiment of the application;
FIG. 3 is a schematic flow chart of a proxy communication method of a test device in a test system according to an embodiment of the present application;
FIG. 4 shows a schematic diagram of a communication relationship of a further test system according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments.
The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present invention.
The terms "comprises," "comprising," "including," or any other variation thereof, are intended to cover a specific feature, number, step, operation, element, component, or combination of the foregoing, which may be used in various embodiments of the present invention, and are not intended to first exclude the presence of or increase the likelihood of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing.
Furthermore, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and should not be construed as indicating or implying relative importance.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the invention belong. The terms (such as those defined in commonly used dictionaries) will be interpreted as having a meaning that is the same as the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein in connection with the various embodiments of the invention.
The technical scheme of the application is applied to a test environment, and mainly aims at the communication mode of a test system, the same proxy service library is configured in an upper computer and test equipment, the same proxy service end is established through the proxy service library, and the proxy service end uniformly carries out an internet communication method or a local area network communication method so as to realize that different communication modes are aggregated in one communication method service, thereby reducing maintenance cost.
The technical scheme of the application is described in the following specific embodiments.
Example 1
As shown in fig. 1, a schematic structural diagram of a test system according to the present embodiment is shown, where the test system includes: the upper computer 100, the test equipment 200 and the server 300.
The upper computer 100 is a machine for testing the test devices 200 through automatic testing, and may be a computer, a special test device, or the like, the test device 200 is a tested device participating in the testing, and the server 300 is a server device for providing internet communication, and the server may be a server for testing connection between the inside and the outside of a network, or may be a server of an operator for providing network services externally.
When the upper computer 100 works, the upper computer 100 determines a current communication mode according to the communication parameters transmitted by itself, and establishes a first communication proxy service.
The communication parameters are determined by a test program during testing or determined by a worker, and mainly determine a communication mode, wherein the communication mode is a local area network communication mode and an internet communication mode, and different test items exist under two different communication modes, and the communication mode mainly refers to a communication mode between the upper computer 100 and the test equipment 200. The first proxy service is a service for performing network communication with the outside generated by the proxy program in the upper computer 100, and is a server when the first proxy service performs internal communication with the upper computer 100, and is a client when the first proxy service performs external communication.
If the communication mode of the upper computer 100 is internet communication, a communication connection is established with the server through the first communication proxy service, and a unique connection identifier of the test device is used for matching with the test device on the server, and a communication connection with the test device is established through the server.
The internet communication means that the upper computer 100 needs to perform communication connection with the test device 200 through a data transmission mode of the internet, and may also be considered that the upper computer 100 performs data interaction through a wan (wide area network) port of itself and a wan port of the test device 200. At this time, the upper computer and the server 300 need to establish communication connection first, then match with other connected devices on the server 300 through the unique connection identifier of the test device, if the test device is matched, it means that the test device is also connected with the server through the internet, and at this time, the communication connection between the upper computer 100 and the test device 200 can be realized through the server.
If the communication mode of the upper computer is local area network communication, establishing communication connection with the test equipment through the first communication proxy service;
the lan communication refers to network communication through the established lan, and may also be considered that the upper computer 100 performs data interaction through its lan (local area network) port and the lan port of the test device 200. The local area network can be established by only the upper computer 100 and the test equipment 200 without the server 300, so that when the local area network is in communication, firstly, the upper computer needs to ensure that the upper computer and the test equipment are in the same network environment, meanwhile, the upper computer needs to acquire the ip and the port number of the test equipment for the local area network, and the local area network communication is realized according to the ip and the port number.
The local area network communication and the internet communication are both realized by the first proxy service in the host computer 100, wherein the first proxy service is used as a client to interact with the server during the internet communication, and the communication request is usually initiated by the host computer 100 to the test device because the test is mainly conducted by the host computer during the local area network communication, so that the first proxy service initiates the communication request to the server or the test device in the role of the client to establish the communication connection between the host computer 100 and the test device 200 or the server 300 when the test starts.
And the test equipment determines the current communication mode according to the input communication parameters and establishes a second communication proxy service.
Similarly, the test device determines its own communication mode according to the communication parameters, and the test device itself establishes the second communication proxy service.
If the communication mode of the test equipment is Internet communication, communication connection is established through the second communication proxy service and the server, a unique connection identifier of the test equipment is sent to the server, and communication connection is established with an upper computer matched with the unique connection identifier.
After the test device 200 is connected with the server, a unique connection identifier of the test device itself is sent to the server, and as can be seen from the interaction between the upper computer 100 and the server, the test device is matched with the test device through the unique connection identifier after the upper computer 100 is connected with the server, so that the test device needs to upload the unique connection identifier of the test device after the test device is connected with the server, the upper computer can find the test device according to the unique connection identifier of the test device and then realize communication connection with the test device through the server, and accordingly, the test device waits for whether the test device is matched with the server or not after being connected with the server, if the test device is matched with the server, the upper computer 100 needs to be in communication connection with the test device itself, and at the moment, corresponding communication connection can be established with the upper computer 100.
If the communication mode of the test equipment is local area network communication, communication connection is established between the second communication proxy service and the upper computer.
If the communication is a lan communication, the second communication proxy service is similar to the above description of the lan communication performed by the upper computer 100, and is used as a server to wait for a communication connection request sent by the upper computer 100 from the lan side, and then perform a corresponding communication operation according to a communication protocol.
The second communication proxy service is mainly used for assisting the test device 200 to communicate with the server 300 through the internet or communicate with the upper computer 100 through a local area network, and is a client when the test device 200 communicates with the server, and is a server when the test device 200 communicates with the upper computer 100.
In the above communication operation, the communication protocol may be TCP, UDP or other custom communication protocols, and the specific communication method is not limited in this embodiment. It can be understood that the first communication proxy service and the second communication proxy service can both support the communication method or the communication protocol, and the communication between the upper computer and the test device is completely realized by the proxy service, so that for a developer, maintenance of the communication method can be completed only by maintaining a program library related to the proxy service, and for the upper computer and the test device, no matter what communication mode is, only the same proxy service needs to be called, the communication method is more concise, and the condition that different communication modes call different services or programs is avoided.
Example 2
As shown in fig. 2, the proxy communication method of the host computer in this embodiment includes:
step S100, determining a current communication mode according to the input communication parameters, and establishing a first communication proxy service;
the communication parameter is data about the kind of communication and the communication object carried in the outside world or the program, such as data of unique connection identification, IP address, port number, and the like of the test device.
And when the communication parameters comprise the unique connection identifier of the test equipment, the communication mode is the Internet communication, and if the communication parameters comprise the IP address and the port number of the test equipment, the communication mode is the local area network communication.
It can be understood that when the internet is in communication, the upper computer is mainly connected with the wide area network by virtue of the server so as to communicate with the testing device connected with the other wide area network, and because the IP can be dynamically changed in the wide area network, the upper computer mainly determines the testing device through the unique connection identifier, so that when the communication parameter carries the unique connection identifier, the communication mode at the moment is the internet communication mode. In the local area network, the IP is fixed, so that only the port number and the corresponding IP address are determined, and when the communication parameter has no unique connection identifier and only the IP address and the port number, the communication mode can be determined to be the local area network communication.
The specific communication method may be carried directly in the communication parameters, for example, 1 represents internet communication, 0 represents local area network communication, or the like.
The first communication proxy service is a service for proxy network communication between the upper computer and the external equipment, the external equipment is a client, the upper computer is a service end, and the data interaction between the upper computer and the external equipment is performed through the first communication proxy service.
And step 200, if the communication mode is internet communication, establishing communication connection with a server through the first communication proxy service, matching the server with the test equipment through a unique connection identifier of the test equipment, and establishing communication connection with the test equipment through the server.
After the communication mode is determined, corresponding communication operation can be performed according to the communication mode, when the communication mode is internet communication, the first communication proxy service can establish communication connection with the server through a communication protocol, for example, when the communication protocol is TCP protocol, connection is established between the first communication proxy service and the server through three-step handshaking, after connection is established, the first communication proxy service can be matched with the server through a unique connection identifier of the test equipment, whether the test equipment is also connected with the server is determined, and if the matching is successful, connection is established between the first communication proxy service and the server through the server.
It can be understood that, the connection is established here to test the test device by the upper computer, there is necessarily data interaction, and the test data during interaction is communicated by the server, so after the communication is established, the first communication proxy service synchronously starts the first thread and the second thread;
the first thread is used for taking the first communication proxy service as a client to monitor whether the server has data transmission or not, and if so, the first communication proxy service is used as a server to transmit the transmitted data to the upper computer equipment;
the second thread is used for taking the first communication proxy service as a server to monitor whether the upper computer has data to be transmitted out or not, and if so, the first communication proxy service is transmitted to the server by taking the first communication proxy service as a client.
The first thread and the second thread are synchronously operated, the first thread is used for monitoring data transmitted from the outside of the upper computer, the second thread is used for monitoring data to be transmitted from the inside of the upper computer, so that the data receiving and sending are synchronously realized, and the two threads are also generated and managed by the first communication proxy service, and the upper computer does not need to additionally execute other communication programs.
And step S300, if the communication mode is local area network communication, establishing communication connection with the test equipment through the first communication proxy service.
Similarly to the case where the communication mode is internet communication, when the communication mode is lan communication, a communication connection is established in the lan by the first communication proxy service and the test device, and the first communication proxy service at this time is also a client for the test device.
Simultaneously, after communication connection is established with the test equipment, the first communication proxy service synchronously starts a first thread and a second thread;
the first thread is used for taking the first communication proxy service as a client to monitor whether the test equipment has data transmission or not, and if so, the first communication proxy service is used as a server to transmit the transmitted data to the upper computer equipment;
the second thread is used for taking the first communication proxy service as a server to monitor whether the upper computer has data to be transmitted out, and if so, the first communication proxy service is transmitted to the test equipment by taking the first communication proxy service as a client.
In this embodiment, the first communication proxy service of the upper computer is a client when communicating with the outside, and is a server when communicating with the inside, and monitors the data flow of the inside and the outside through two threads respectively, so as to realize the communication between the outside and the inside.
As shown in fig. 3, the proxy communication method of the test device in this embodiment includes:
step S400, determining a current communication mode according to the input communication parameters, and establishing a second communication proxy service;
similarly to the upper computer, the test device also determines a communication mode according to the communication parameters before establishing the communication connection, and establishes the second communication proxy service to perform corresponding communication operation.
For the test equipment, the communication parameters also comprise data such as unique connection identification of the test equipment, an upper computer IP address, a port number and the like.
The specific judgment method is similar to the judgment method in step S100, and will not be described here again.
Step S500, if the communication mode is Internet communication, establishing communication connection through the second communication proxy service and a server, sending a unique connection identifier of the server to the server, and establishing communication connection with an upper computer matched with the unique connection identifier;
when the Internet is used for communication in a communication mode, the second communication proxy service can be used as a client to establish communication with the server, and can upload the unique connection identifier of the second communication proxy service, after the upper computer is connected with the server, the test equipment is found according to the matching of the unique connection identifier, and then the test equipment can communicate with the upper computer through the Internet.
Likewise, after the second communication proxy service establishes communication with the server, the second communication proxy service synchronously starts a third thread and a fourth thread;
the third thread is used for taking the second communication proxy service as a client to monitor the data from the server, determining whether the data is transmitted, if so, taking the second communication proxy service as a server, and transmitting the transmitted data into the test equipment;
the fourth thread is configured to monitor, by using the second communication proxy service as a server, whether the test device has data outgoing, and if so, transmit, by using the second communication proxy service as a client, the data to be transmitted to a server.
It can be understood that the third thread and the fourth thread are used for monitoring the external data and the receiving and transmitting operations of the internal data of the test device respectively, and the second communication proxy service is a client when interacting with the server, and is a server when interacting with the test device.
And step S600, if the communication mode is local area network communication, establishing communication connection with the upper computer through the second communication proxy service.
When the communication mode is local area network communication, the second communication proxy service is used as a server, the first communication proxy service of the upper computer waits for initiating a communication connection establishment request, and after receiving the request, corresponding communication connection is established according to a specific communication protocol.
After the LAN communication is established, the second communication proxy service synchronously starts a third thread and a fourth thread;
the third thread is used for taking the second communication proxy service as a client to monitor the data from the server, determining whether the data is transmitted or not, if yes, taking the second communication proxy service as a server, and transmitting the transmitted data into the test equipment;
the fourth thread is configured to monitor, by using the second communication proxy service as a server, whether the test device has data outgoing, and if so, transmit, by using the second communication proxy service as a client, the data to be transmitted to a server.
Therefore, the communication relationship between the proxy communication method in this embodiment and the test system is shown in fig. 4, the external communication between the upper computer 100 and the test device 200 is completed by means of the first proxy service and the second proxy service, the first proxy service is established by the upper computer 100, the second proxy service is established by the test device 200, the two proxy services are used for processing the internet communication mode and the local area network communication mode, and the data received from the outside and the data sent to the outside can be communicated with the outside only through the internal communication mode and the corresponding proxy service communication mode, so that the communication flow is clearer.
According to the steps, the working logics of the communication proxy services at the two ends of the upper computer and the testing equipment are similar, so that different network communication methods can be realized by using similar program logics although the communication proxy services belong to different terminals, the proxy service programs at the two ends can be easily maintained, the two ends cannot be connected in different modes and have different algorithm logics, the development maintenance pressure is reduced, the communication methods are uniformly completed by the respective proxy, the problem of communication is easier to locate during testing, and the testing efficiency is improved.
The application also provides a terminal device comprising a processor and a memory, the memory storing a computer program which, when run on the processor, performs the proxy communication method.
The terminal device may be an upper computer or a test device for testing, for example, a test for a network camera, and the terminal device may be a computer as the upper computer or a network camera as the test device.
The present application provides a readable storage medium storing a computer program which when run on a processor performs the proxy communication method.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, of the flow diagrams and block diagrams in the figures, which illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules or units in various embodiments of the invention may be integrated together to form a single part, or the modules may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a terminal device (which may be a smart phone, a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention.

Claims (8)

1. A proxy communication method, applied to a host computer, comprising:
determining a current communication mode according to the input communication parameters, and establishing a first communication proxy service; the communication parameters comprise unique connection identifiers of the test equipment;
if the communication mode is internet communication, establishing communication connection with a server through the first communication proxy service, matching the server with test equipment through the unique connection identifier, and establishing communication connection with the test equipment through the server;
if the communication mode is local area network communication, establishing communication connection with the test equipment through the first communication proxy service;
the first communication proxy service synchronously starts a first thread and a second thread;
the first thread is used for taking the first communication proxy service as a client to monitor whether the test equipment has data transmission or not, and if so, the first communication proxy service is used as a server to transmit the transmitted data to the upper computer;
the second thread is used for taking the first communication proxy service as a server to monitor whether the upper computer has data to be transmitted out, and if so, the first communication proxy service is transmitted to the test equipment by taking the first communication proxy service as a client.
2. The proxy communication method of claim 1, wherein the determining the current communication mode based on the entered communication parameters comprises:
and if the communication parameters comprise the unique connection identifier of the test equipment, the communication mode is the Internet communication, and if the communication parameters comprise the IP address and the port number of the test equipment, the communication mode is the local area network communication.
3. The proxy communication method according to claim 1, wherein if the communication mode is internet communication, after establishing a communication connection with a server through the first communication proxy service, further comprising:
the first communication proxy service synchronously starts a first thread and a second thread;
the first thread is used for taking the first communication proxy service as a client to monitor whether the server has data transmission or not, and if so, the first communication proxy service is used as a server to transmit the transmitted data to the upper computer equipment;
the second thread is used for taking the first communication proxy service as a server to monitor whether the upper computer has data to be transmitted out or not, and if so, the first communication proxy service is transmitted to the server by taking the first communication proxy service as a client.
4. A proxy communication method, applied to a test device, comprising:
determining a current communication mode according to the input communication parameters, and establishing a second communication proxy service; the communication parameters comprise unique connection identifiers of the communication parameters;
if the communication mode is internet communication, establishing communication connection with a server through the second communication proxy service, sending the unique connection identifier to the server, and establishing communication connection with an upper computer matched with the unique connection identifier;
if the communication mode is local area network communication, establishing communication connection with the upper computer through the second communication proxy service;
the second communication proxy service synchronously starts a third thread and a fourth thread;
the third thread is used for taking the second communication proxy service as a client to monitor the data from the server, determining whether the data is transmitted, if so, taking the second communication proxy service as a server, and transmitting the transmitted data into the test equipment;
the fourth thread is configured to monitor, by using the second communication proxy service as a server, whether the test device has data outgoing, and if so, transmit, by using the second communication proxy service as a client, the data to be transmitted to a server.
5. The proxy communication method according to claim 4, wherein if the communication mode is lan communication, after establishing a communication connection with the host computer through the second communication proxy service, the proxy communication method further comprises:
the second communication proxy service synchronously starts a third thread and a fourth thread;
the third thread is used for taking the second communication proxy service as a client to monitor the data from the server, determining whether the data is transmitted or not, if yes, taking the second communication proxy service as a server, and transmitting the transmitted data into the test equipment;
the fourth thread is configured to monitor, by using the second communication proxy service as a server, whether the test device has data outgoing, and if so, transmit, by using the second communication proxy service as a client, the data to be transmitted to a server.
6. A test system, comprising: the system comprises an upper computer, test equipment and a server;
the upper computer determines a current communication mode according to communication parameters transmitted by the upper computer and establishes a first communication proxy service; the communication parameters comprise unique connection identifiers of the test equipment;
if the communication mode of the upper computer is internet communication, establishing communication connection with a server through the first communication proxy service, matching the server with test equipment through the unique connection identifier, and establishing communication connection with the test equipment through the server;
if the communication mode of the upper computer is local area network communication, establishing communication connection with the test equipment through the first communication proxy service;
the test equipment determines a current communication mode according to the input communication parameters and establishes a second communication proxy service;
if the communication mode of the test equipment is Internet communication, establishing communication connection with a server through the second communication proxy service, sending a unique connection identifier of the test equipment to the server, and establishing communication connection with an upper computer matched with the unique connection identifier;
if the communication mode of the test equipment is local area network communication, establishing communication connection with the upper computer through the second communication proxy service;
the first communication proxy service synchronously starts a first thread and a second thread;
the first thread is used for taking the first communication proxy service as a client to monitor whether the test equipment has data transmission or not, and if so, the first communication proxy service is used as a server to transmit the transmitted data to the upper computer;
the second thread is used for taking the first communication proxy service as a server to monitor whether the upper computer has data transmission or not, and if so, the first communication proxy service is transmitted to the test equipment by taking the first communication proxy service as a client;
the second communication proxy service synchronously starts a third thread and a fourth thread;
the third thread is used for taking the second communication proxy service as a client to monitor the data from the server, determining whether the data is transmitted, if so, taking the second communication proxy service as a server, and transmitting the transmitted data into the test equipment;
the fourth thread is configured to monitor, by using the second communication proxy service as a server, whether the test device has data outgoing, and if so, transmit, by using the second communication proxy service as a client, the data to be transmitted to a server.
7. A terminal device comprising a processor and a memory, the memory storing a computer program which, when run on the processor, performs the proxy communication method of any one of claims 1 to 5.
8. A readable storage medium, characterized in that it stores a computer program which, when run on a processor, performs the proxy communication method of any one of claims 1 to 5.
CN202311499893.4A 2023-11-13 2023-11-13 Proxy communication method, test system, terminal device and storage medium Active CN117240913B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311499893.4A CN117240913B (en) 2023-11-13 2023-11-13 Proxy communication method, test system, terminal device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311499893.4A CN117240913B (en) 2023-11-13 2023-11-13 Proxy communication method, test system, terminal device and storage medium

Publications (2)

Publication Number Publication Date
CN117240913A CN117240913A (en) 2023-12-15
CN117240913B true CN117240913B (en) 2024-02-13

Family

ID=89098660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311499893.4A Active CN117240913B (en) 2023-11-13 2023-11-13 Proxy communication method, test system, terminal device and storage medium

Country Status (1)

Country Link
CN (1) CN117240913B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148604A (en) * 2020-09-21 2020-12-29 京东数字科技控股股份有限公司 iOS software testing method, device, equipment and computer readable medium
CN114297083A (en) * 2021-12-31 2022-04-08 中国电信股份有限公司 Agent test method, device, electronic equipment and readable medium
WO2022105591A1 (en) * 2020-11-20 2022-05-27 上海连尚网络科技有限公司 Cache server performance test method and apparatus, device, and medium
CN116684489A (en) * 2023-05-09 2023-09-01 深圳市雷鸟网络传媒有限公司 Remote test method, system, device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148604A (en) * 2020-09-21 2020-12-29 京东数字科技控股股份有限公司 iOS software testing method, device, equipment and computer readable medium
WO2022105591A1 (en) * 2020-11-20 2022-05-27 上海连尚网络科技有限公司 Cache server performance test method and apparatus, device, and medium
CN114297083A (en) * 2021-12-31 2022-04-08 中国电信股份有限公司 Agent test method, device, electronic equipment and readable medium
CN116684489A (en) * 2023-05-09 2023-09-01 深圳市雷鸟网络传媒有限公司 Remote test method, system, device and storage medium

Also Published As

Publication number Publication date
CN117240913A (en) 2023-12-15

Similar Documents

Publication Publication Date Title
EP2220852B1 (en) Communicating a selection of a potential configuration
CN109450948B (en) Data transmission method and device
CN112165447B (en) WAF equipment-based network security monitoring method, system and electronic device
US8732694B2 (en) Method and system for performing services in server and client of client/server architecture
CN113556267A (en) Terminal equipment state monitoring method and system and edge Internet of things proxy gateway
JP2008098813A (en) Information communication device, information communication method, and program
CN111866063A (en) Online updating system, method and device for industrial Internet of things AI algorithm
WO2023040380A1 (en) Webrtc communication method and system
CN113114778A (en) Data transmission method and device, electronic equipment and storage medium
CN110442506B (en) Log acquisition method, device, service server, system and storage medium
CN110278148B (en) data compatibility gateway system
JP6429559B2 (en) COMMUNICATION DEVICE, COMMUNICATION SYSTEM, INFORMATION PROCESSING METHOD, AND PROGRAM
US20030225890A1 (en) State token for thin client devices
CN117240913B (en) Proxy communication method, test system, terminal device and storage medium
CN108235083B (en) Television log information acquisition method and device
CN106657076B (en) TCP service implementation method and device for network name space
JP5093012B2 (en) COMMUNICATION CONTROL DEVICE, COMMUNICATION CONTROL METHOD, AND COMMUNICATION CONTROL PROGRAM
US10819755B1 (en) Communications apparatus, systems, and methods for preventing and/or minimizing session data clipping
CN117640724B (en) Data forwarding method, system, computer equipment and storage medium
KR20150012908A (en) Method for communication using ip address eschanged via near field communication and apparatus for the same
CN114363204A (en) Request monitoring method, network device and storage medium
CN114338477A (en) Communication link monitoring method, device, equipment and storage medium
JP6672428B2 (en) Communication device, communication system, communication method and program
JP5461646B2 (en) Remote connection process monitoring method and remote connection monitoring system
CN107809333B (en) Upgrading method of cable modem and cable modem

Legal Events

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