Data transmission monitoring method and device, electronic equipment and storage medium
By establishing a long connection with the client on the server and establishing a second process for monitoring, the problem of inaccurate statistics of the frame number and transmission rate of the message data in the prior art is solved, and accurate monitoring of the frame rate and transmission rate is achieved.
Patent Information
- Application Number
- CN202510145395.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art cannot accurately count information such as the total number of message data sent per second, the number of successful frames, the number of failed frames, and the size of transmitted packets per second according to service needs.
By establishing a connection on the server, establishing a long connection with the client, issuing business data in response to client requests, and establishing a second process for monitoring at the same time. After receiving the monitoring message, the second process subscribes to process the monitoring content and calculates the frame rate and the transmission rate.
It realizes accurate monitoring of the number of frame rates, transmission rates, and success/failure frame rates sent by the server, and meets the statistical requirements of business needs.
Smart Images

Figure CN119996481A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data transmission processing, and in particular to a data transmission monitoring method, device, electronic device, and storage medium. Background Art
[0002] The server and client can transmit data based on the TCP long connection mode.
[0003] In the related art, it is impossible to accurately count the total number of message data frames sent per second, the number of successful frames, the number of failed frames, and the size of data packets transmitted per second according to business needs. Summary of the invention
[0004] The embodiments of the present application provide a data transmission monitoring method, device, electronic device, and storage medium to implement monitoring of transmission data.
[0005] The present application embodiment adopts the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a data transmission monitoring method, which is executed by a server, and the monitoring method includes:
[0007] Establish a connection with the client;
[0008] In response to a request from the client, sending service data to the client as a first process;
[0009] In response to the first process, establishing a second process for monitoring the first process;
[0010] According to the second process, monitoring data is obtained.
[0011] In some embodiments, in response to the first process, establishing a second process for monitoring the first process includes:
[0012] While the first process sends the business data to the client, monitoring information is established for the second process so that the second process subscribes to and processes the monitoring content after receiving the monitoring message. The monitoring content includes at least: the timestamp, data packet size, and receiving status of the business data sent to the client in the first process.
[0013] In some embodiments, obtaining monitoring data according to the second process includes:
[0014] After the second process subscribes to and receives the monitoring message, it processes the monitoring content;
[0015] The frame rate and transmission rate of the current client number are calculated according to the client number and the timestamp carried in the monitoring content.
[0016] In some embodiments, in response to the request of the client, sending the service data to the client as a first process includes:
[0017] According to the data request of the client, the business data in the cache or database is sent to the client.
[0018] In some embodiments, establishing a connection with the client includes:
[0019] A long connection is established with the client to send digital twin data to the client.
[0020] In some embodiments, obtaining monitoring data according to the second process includes:
[0021] After the second process receives the monitoring information, the frame rate and the transmission rate are counted according to the client number and the second dimension.
[0022] In some embodiments, the method further comprises:
[0023] The monitoring data is first retained in the local cache, and after waiting for a set period of time, is stored in the database to obtain the final monitoring statistical results.
[0024] In a second aspect, an embodiment of the present application further provides a data transmission monitoring device, which is executed by a server, and the monitoring device includes:
[0025] Long connection module, used to establish connection with the client;
[0026] A first response module, used for responding to a request from the client and sending service data to the client as a first process;
[0027] A second response module, configured to establish a second process for monitoring the first process in response to the first process;
[0028] The monitoring module is used to obtain monitoring data according to the second process.
[0029] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor; and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, cause the processor to perform the above method.
[0030] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes the above method.
[0031] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: first, establish a connection with the client; then, in response to the request of the client, send business data to the client as the first process; then, in response to the first process, establish a second process for monitoring the first process; according to the second process, obtain monitoring data. Through the above method, accurate monitoring of the frame rate, transmission rate, and success / failure frame rate sent by the server can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0033] Figure 1 A schematic diagram of a connection between a client and a server in the related art;
[0034] Figure 2 A timing diagram of the client and the server in the embodiment of the present application;
[0035] Figure 3 This is a flow chart of a data transmission monitoring method in an embodiment of the present application;
[0036] Figure 4 This is a schematic diagram of the structure of the data transmission monitoring device in an embodiment of the present application;
[0037] Figure 5 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0039] In the field of software development, we often design architecture patterns for server-client interaction that require low latency and high-frequency data transmission. This pattern requires the use of TCP long connection protocols. There are many types of transmission protocols, but the most common ones are HTTP short connection and TCP long connection. Figure 1 As shown, it is necessary to monitor and count the frame rate and network transmission rate of the long-link sending module.
[0040] In related technologies, when designing a communication service end, it is often necessary to consider the stability of the service and whether the communication data is successfully sent, which leads to the need to count the total number of message data frames sent per second, the number of successful frames, the number of failed frames, and the size of data packets transmitted per second.
[0041] In some solutions, timers and counters are used to implement this function. In the implementation principle: at the beginning and end of each frame, a timer is used to record the timestamp, and a counter is used to count the number of frames.
[0042] The specific implementation includes: In the Handler that receives the data packet, record the start timestamp. When the data packet is processed and ready to send a reply, record the end timestamp. Use the start and end timestamps to calculate the frame processing time. Use a counter to accumulate the number of frames. Calculate the average frame rate regularly (for example, every second).
[0043] In other solutions, a third-party library is used, and its implementation principle is to use a special monitoring library to count the frame rate.
[0044] The specific implementation includes: integrating third-party libraries, such as Metrics, Prometheus, etc. At the beginning and end of frame processing, the timers and counters provided by the libraries are used. These libraries can provide rich monitoring functions, such as graphical display, data persistence, etc.
[0045] In other solutions, Netty's own statistical functions are used. The implementation principle is: using the ChannelHandler interface and related statistical functions provided by Netty.
[0046] The specific implementation includes: creating a custom ChannelHandler and registering a counter in the handlerAdded() method. In the channelRead() method, use the counter to record the frame processing time. Use Netty's own monitoring tools, such as Netty's JMX monitoring tool, to observe the statistical data.
[0047] In response to the above problems, in the embodiments of the present application, a set of lightweight and extremely low resource consumption monitoring implementation solutions is developed and compiled for the Netty long connection framework which does not have very accurate frame rate and rate statistics.
[0048] like Figure 2 As shown in the figure, the digital twin long connection interaction scenario is used as an example to explain in detail. The interaction end mainly includes users, server long connection, service layer, data layer and log / extension. The specific process includes:
[0049] First, the user requests to obtain digital twin data, which is transferred to the service layer for processing through a long connection on the server side. Secondly, the service layer obtains the required data to the data layer according to the request conditions, and the data layer returns the data. The service layer processes the data. The service layer uses asynchronous publishing to monitor information. The data layer also implements subscription processing for other threads. Finally, at the service layer, the monitoring frequency information, transmission rate information, etc. are calculated, and the disk log is stored in the log / extension. In addition, the service layer returns the available data after processing the data, and returns the digital twin data to the user. The data transmission monitoring method in the embodiment of the present application is mainly used for Figure 2 The service layer is shown.
[0050] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0051] The present application embodiment provides a data transmission monitoring method, such as Figure 3 As shown, a flow chart of a data transmission monitoring method in an embodiment of the present application is provided, and the method at least includes the following steps S310 to S340:
[0052] Step S310: Establish a connection with the client.
[0053] The server and the client need to establish a connection first, the client is used to request data from the server, and the server is used to send data to the client.
[0054] Exemplarily, the client may be the vehicle side in a vehicle-road collaboration scenario, and the vehicle side is used to obtain the digital twin data of the server side.
[0055] Step S320: in response to the request of the client, the service data is sent to the client as the first process.
[0056] The server responds to the request of the client and sends the business data to the client. The whole process is referred to as the first process.
[0057] Step S330: In response to the first process, establish a second process for monitoring the first process.
[0058] The server responds to the first process and establishes a second process for monitoring the first process. It can be understood that the second process or the first process can usually be implemented through a lightweight Google Guava: EventBus. It should be noted that EventBus is the implementation of the event publishing and subscription function in Guava, and is an implementation scheme of the publish / subscribe mode in the design pattern. Register subscribers through eventBus.register, publish events through the eventBus.post method, and then execute the annotated methods with consistent parameter types in all subscribers according to the type of the published event (class Type), thereby realizing the publishing and subscribing functions.
[0059] Step S340: Obtain monitoring data according to the second process.
[0060] According to the second process, the monitoring data is obtained in the server, and the monitoring data includes but is not limited to frequency information, transmission rate information, etc.
[0061] For example, in an interactive scenario where digital twins are connected, the server monitors the accuracy of the data frame rate and transmission rate sent to the client data and performs statistics.
[0062] Through the above method, the frame rate, transmission rate, and success / failure frame rate sent by the server can be monitored. It is particularly suitable for vehicle-road collaboration scenarios, where the vehicle is the client and the cloud is the server. According to business needs, the frame rate and transmission rate of traffic data in each vehicle sent from the cloud to a large number of vehicles need to be counted, and these data can be visualized through a large-screen digital twin system after statistics.
[0063] In one embodiment of the present application, in response to the first process, a second process for monitoring the first process is established, including: while the first process sends the business data to the client, monitoring information is established for the second process, so that the second process subscribes to receive the monitoring message and processes the monitoring content, and the monitoring content includes at least: the timestamp, data packet size, and receiving status of the business data sent to the client in the first process.
[0064] In the process of sending business data to the client, while the first process sends the business data to the client, monitoring information is established for the second process, so that the second process subscribes to receive the monitoring message and processes the monitoring content. In other words, when the first process sends data, it throws a piece of monitoring information to the second process as the monitoring process. In this way, after the second process subscribes to receive this message, it processes the monitoring content, and the monitoring content records: the timestamp, data packet size, receiving status (success / failure, failure reason), etc. of the business data just sent to the client by the first process.
[0065] Considering that in a concurrent environment, if there is no correct synchronization mechanism, shared data may be in an inconsistent state. For example, without locking, one thread modifies a variable, and another thread reads the variable before the modification is completed. Therefore, it is necessary to establish monitoring information for the second process while the first process sends the business data to the client, so that the second process can subscribe to the monitoring message and process the monitoring content.
[0066] It should be noted that the failure reasons include, but are not limited to, failure to send, server discarding due to failure of verification after receiving by the client, etc. The failure reasons are not specifically limited in the embodiments of the present application.
[0067] It can be understood that the monitoring content includes, but is not limited to, the timestamp, data packet size and receiving status of the business data sent to the client in the first process.
[0068] In one embodiment of the present application, obtaining monitoring data according to the second process includes: processing the monitoring content after the second process subscribes to and receives the monitoring message; calculating the frame rate and transmission rate of the current client number based on the client number and the timestamp carried in the monitoring content.
[0069] After the second process subscribes to and receives the monitoring message, the monitoring content is processed, and the frame rate and transmission rate of the current client number are calculated based on the carried client number and the timestamp.
[0070] The data interaction between the server and the client is still implemented by a long connection framework such as netty channelHandler, and the monitoring data is published to asynchronous threads by the mature guava publish-subscribe tool plug-in, which is reliable and stable.
[0071] The above solution does not use timestamp subtraction to determine whether a statistical period has been reached, and then use the average strategy to implement counting. Instead, it uses an asynchronous publish-subscribe framework to process the time of the frame data separately, and during processing, it is determined by assigning milliseconds to seconds to obtain the second to which the frame belongs, without concurrent processing problems.
[0072] Specifically, when sending data to the client, a definition entity FrameBean information is asynchronously published. The FrameBean contains information such as the client number SN, timestamp time, message size packageSize, state state, etc. The key codes include:
[0073] longtime=System.currentTimeMillis();
[0074] EventManager.tcpEventBus.post(FrameBean.builder().key(sn).time(time).pack ageSize(12310).state(0).build());
[0075] Then, the message is received through the subscription thread, and the frame rate of the sn is calculated through the SN and the timestamp time. The transmission rate is the same.
[0076] long second = event.getTime() / 1000*1000; The timestamp is divided by and then multiplied by 1000 to get the whole second, so that the number of data in the same second can be obtained. The transmission rate is calculated by adding the size of the data packets in this second. The key code includes:
[0077] long second=event.getTime() / 1000*1000;
[0078] String snSecondKey=event.getKey()+″,″+second;
[0079] The above method is based on mature technical tool frameworks and protocols, reasonably assembles and transmits data, and uses a log framework to store data on disk. In the data caching and transmission links, it does not change the original data transmission process and has no security issues.
[0080] In one embodiment of the present application, the sending of business data to the client in response to the request of the client as a first process includes: sending the business data in a cache or a database to the client according to the data request of the client.
[0081] The business data can be stored in a cache or database, and the corresponding business data can be sent to the client according to the client's data request. Asynchronous analysis and generation of statistical result data do not affect the main process. Therefore, it does not affect the stability of the main business function. For its own monitoring logic such as frame rate and message size, independent threads and independent processing of its own exceptions ensure the stability of its own method.
[0082] In one embodiment of the present application, establishing a connection with the client includes: establishing a long connection with the client to send digital twin data to the client.
[0083] After establishing a long connection, the digital twin data is sent to the client. The long connection adopts the TCP / HTTP protocol. TCP (Transmission Control Protocol): provides reliable and orderly data transmission to ensure data integrity and order. Commonly used in applications that require reliable connections, such as web browsing, email, and file transfer. HTTP (HyperText Transfer Protocol) is a protocol for the application layer of distributed, collaborative, and hypermedia information systems. It is the most widely used network protocol on the Internet, mainly used to transmit hypertext (such as HTML documents). The HTTP protocol defines how data is exchanged between a client (usually a browser) and a server.
[0084] In one embodiment of the present application, obtaining monitoring data according to the second process includes: after the second process receives the monitoring information, counting the frame rate and the transmission rate according to the client number and the second dimension.
[0085] In specific implementation, after the second process receives the monitoring information, each time a piece of monitoring information is received, the frame rate and the transmission rate are counted according to the client number and the second dimension.
[0086] For example, the data of seconds 1731310526 is summarized as follows:
[0087] Second 1731310526 is a second timestamp. The first monitoring data arrives, recording clientA-1731310526: total frame number 1, successful frame number 1, failed frame number 0, total size of data packets within seconds 100kb The first monitoring data arrives, find the clientA-1731310526 flag, and then add to its data: clientA-1731310526: total frame number 2 (second data), successful frame number 2 (second data is also successful), failed frame number 0, total size of data packets within seconds 190kb (100kb + 90kb second data size) and so on.
[0088] According to the above method, useful information such as the total number of frames, the number of successful frames, the number of failed frames, the total size of data packets per second (that is, the data rate sent to this client, such as 800Kbps / s) is summarized.
[0089] In one embodiment of the present application, the method further includes: retaining the monitoring data in a local cache first, and storing it in a database after waiting for a set period of time to obtain a final monitoring statistical result.
[0090] For the generated second dimension report, it is first retained in the local cache, and after a certain period of time, such as 5 seconds, it is stored in the database to obtain the final statistical results. In addition, in the embodiment of the present application, an alarm module is also used to store log information of a certain number of days based on the logback log framework combined with some disk space, so that the data information of historical days can be traced back to achieve the purpose of troubleshooting.
[0091] The embodiment of the present application also provides a data transmission monitoring device 400, such as Figure 4 As shown, a schematic diagram of the structure of a data transmission monitoring device in an embodiment of the present application is provided, wherein the data transmission monitoring device 400 comprises at least: a long connection module 410, a first response module 420, a second response module 430 and a monitoring module 440, wherein:
[0092] In one embodiment of the present application, the long connection module 410 is specifically used to establish a connection with a client.
[0093] The server and the client need to establish a connection first, the client is used to request data from the server, and the server is used to send data to the client.
[0094] Exemplarily, the client may be the vehicle side in a vehicle-road collaboration scenario, and the vehicle side is used to obtain the digital twin data of the server side.
[0095] In one embodiment of the present application, the first response module 420 is specifically used to: respond to the request of the client, send business data to the client as a first process.
[0096] The server responds to the request of the client and sends the business data to the client. The whole process is referred to as the first process.
[0097] In one embodiment of the present application, the second response module 430 is specifically used to: establish a second process for monitoring the first process in response to the first process.
[0098] The server responds to the first process and establishes a second process for monitoring the first process. It can be understood that the second process or the first process can usually be implemented through a lightweight Google Guava: EventBus. It should be noted that EventBus is the implementation of the event publishing and subscription function in Guava, and is an implementation scheme of the publish / subscribe mode in the design pattern. Register subscribers through eventBus.register, publish events through the eventBus.post method, and then execute the annotated methods with consistent parameter types in all subscribers according to the type of the published event (class Type), thereby realizing the publishing and subscribing functions.
[0099] In one embodiment of the present application, the monitoring module 440 is specifically used to obtain monitoring data according to the second process.
[0100] According to the second process, the monitoring data is obtained in the server, and the monitoring data includes but is not limited to frequency information, transmission rate information, etc.
[0101] For example, in an interactive scenario where digital twins are connected, the server monitors the accuracy of the data frame rate and transmission rate sent to the client data and performs statistics.
[0102] In one embodiment of the present application, the second response module 430 is also used to
[0103] While the first process sends the business data to the client, monitoring information is established for the second process so that the second process subscribes to and processes the monitoring content after receiving the monitoring message. The monitoring content includes at least: the timestamp, data packet size, and receiving status of the business data sent to the client in the first process.
[0104] In one embodiment of the present application, the monitoring module 440 is also used to
[0105] After the second process subscribes to and receives the monitoring message, it processes the monitoring content;
[0106] The frame rate and transmission rate of the current client number are calculated according to the client number and the timestamp carried in the monitoring content.
[0107] In one embodiment of the present application, the first response module 420 is further configured to:
[0108] According to the data request of the client, the business data in the cache or database is sent to the client.
[0109] In one embodiment of the present application, the long connection module 410 is also used
[0110] A long connection is established with the client to send digital twin data to the client.
[0111] In one embodiment of the present application, the monitoring module 440 is also used to
[0112] After the second process receives the monitoring information, the frame rate and the transmission rate are counted according to the client number and the second dimension.
[0113] In one embodiment of the present application, it further includes: a storage module for
[0114] The monitoring data is first retained in the local cache, and after waiting for a set period of time, is stored in the database to obtain the final monitoring statistical results.
[0115] It can be understood that the above-mentioned data transmission monitoring device can implement each step of the data transmission monitoring method provided in the above-mentioned embodiment, and the relevant explanations about the data transmission monitoring method are applicable to the data transmission monitoring device and will not be repeated here.
[0116] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 5 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0117] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0118] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0119] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a data transmission monitoring device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
[0120] Establish a connection with the client;
[0121] In response to a request from the client, sending service data to the client as a first process;
[0122] In response to the first process, establishing a second process for monitoring the first process;
[0123] According to the second process, monitoring data is obtained.
[0124] The above application Figure 3 The method performed by the data transmission monitoring device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0125] The electronic device may also perform Figure 3 The method executed by the data transmission monitoring device in the embodiment of the present invention is realized Figure 3 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.
[0126] The present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to execute Figure 3 The method performed by the data transmission monitoring device in the embodiment shown is specifically used to perform:
[0127] Establish a connection with the client;
[0128] In response to a request from the client, sending service data to the client as a first process;
[0129] In response to the first process, establishing a second process for monitoring the first process;
[0130] According to the second process, monitoring data is obtained.
[0131] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0132] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0133] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0135] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0136] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0137] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0138] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, commodity or device including the element.
[0139] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0140] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A data transmission monitoring method, wherein: Executed by the server, the monitoring method includes: Establish a connection with the client; In response to a request from the client, sending service data to the client as a first process; In response to the first process, establishing a second process for monitoring the first process; According to the second process, monitoring data is obtained.
2. The method of claim 1, wherein: The step of establishing a second process for monitoring the first process in response to the first process includes: While the first process sends the business data to the client, monitoring information is established for the second process so that the second process subscribes to and processes the monitoring content after receiving the monitoring message. The monitoring content includes at least: the timestamp, data packet size, and receiving status of the business data sent to the client in the first process.
3. The method of claim 2, wherein: The step of obtaining monitoring data according to the second process includes: After the second process subscribes to and receives the monitoring message, it processes the monitoring content; The frame rate and transmission rate of the current client number are calculated according to the client number and the timestamp carried in the monitoring content.
4. The method of claim 1, wherein: The step of sending the service data to the client in response to the request of the client as a first process includes: According to the data request of the client, the business data in the cache or database is sent to the client.
5. The method of claim 1, wherein: The step of establishing a connection with the client comprises: A long connection is established with the client to send digital twin data to the client.
6. The method of claim 3, wherein: The step of obtaining monitoring data according to the second process includes: After the second process receives the monitoring information, the frame rate and the transmission rate are counted according to the client number and the second dimension.
7. The method of claim 1, wherein: The method further comprises: The monitoring data is first retained in the local cache, and after waiting for a set period of time, is stored in the database to obtain the final monitoring statistical results.
8. A data transmission monitoring device, wherein: Executed by the server, the monitoring device includes: Long connection module, used to establish connection with the client; A first response module, used for responding to a request from the client and sending service data to the client as a first process; A second response module, configured to establish a second process for monitoring the first process in response to the first process; The monitoring module is used to obtain monitoring data according to the second process.
9. An electronic device, comprising: processor; as well as A memory arranged to store computer executable instructions, which when executed cause the processor to perform the method of any one of claims 1 to 7.
10. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of application programs, causes the electronic device to execute any one of the methods of claims 1 to 7.