Method, device and storage medium for parsing inter-device communication data

By acquiring target device parameters and parsing requests, and utilizing communication ports and data parsing libraries to parse inter-device communication data, the problem of low efficiency in parsing inter-device communication data is solved, achieving efficient data parsing and improved development quality.

CN116339745BActive Publication Date: 2025-12-16HONGHU WANLIAN (JIANGSU) TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310326786.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2025-12-16
Estimated Expiration
2043-03-30

AI Technical Summary

Technical Problem

Existing technologies have low efficiency in parsing communication data between devices, and each business scenario requires rewriting code, leading to a decline in development quality.

Method used

When a target peripheral device is detected to trigger the execution of a target device service, a target parsing request matching the target device service is obtained. Device parameters are obtained using the target parsing file, and data is obtained and parsed through the communication port. The data is then parsed using a matching data parsing library, and finally the parsing result is sent to the receiver.

Benefits of technology

It enables direct data communication between devices with various data formats, improves the parsing efficiency of communication data between devices, reduces repetitive coding work, and enhances development quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116339745B_ABST
    Figure CN116339745B_ABST
Patent Text Reader

Abstract

The application discloses a kind of inter-device communication data analysis method, device, equipment and storage medium.The method comprises: when detecting that target peripheral device triggers execution target device service, obtain target analysis request matched with the target device service;By executing target analysis file matched with the target analysis request, obtain target device parameter matched with the target peripheral device;According to target device parameter, obtain the communication port between target peripheral device and host device, and pre-acquire communication data matched with target device service through communication port;Using data analysis library matched with target device parameter, target data is analyzed, and the analysis result is sent to the receiver matched with target device service through communication port.By the technical scheme of the application, direct data communication between devices of various data formats can be realized, and the analysis efficiency of inter-device communication data of various data formats is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and medium for parsing communication data between devices. Background Technology

[0002] With the continuous development of existing technologies, an increasing number of peripheral devices are beginning to have the ability to connect to terminals or servers and realize data interaction functions. During data communication, it is often necessary to parse the communication data between the peripheral device and the connected host device.

[0003] In existing technologies, the open-source HarmonyOS system is typically used to parse communication data between devices. When new peripheral devices are connected to the host device in new business scenarios and need to communicate with each other, the open-source HarmonyOS system listens for data communication events, identifies the code, service, and data parsing library that match the event, and writes code to generate new code for parsing the communication data.

[0004] In the process of realizing this invention, the inventors discovered the following problems with the existing technology: on the one hand, the data parsing library and services for various business scenarios are mixed and analyzed, which has poor reusability, and each business scenario requires rewriting the code, so the quality of the peripheral system layer code cannot be effectively guaranteed; on the other hand, if each business scenario requires development and modification, it will increase the workload of software development, cause a decline in development quality, and lead to a decrease in the parsing efficiency of communication data between devices. Summary of the Invention

[0005] This invention provides a method, apparatus, device, and medium for parsing communication data between devices, which can solve the problem of low parsing efficiency of communication data between devices in the prior art.

[0006] In a first aspect, the present invention provides a method for parsing inter-device communication data, executed by a host device connected to peripheral devices, the method comprising:

[0007] When a target peripheral device is detected to trigger the execution of a target device service, a target parsing request matching the target device service is obtained;

[0008] By executing the target parsing file that matches the target parsing request, the target device parameters that match the target peripheral device are obtained;

[0009] Based on the target device parameters, obtain the communication port between the target peripheral device and the host device, and pre-obtain communication data matching the target device service through the communication port;

[0010] The target data is parsed using a data parsing library that matches the parameters of the target device, and the parsing result is sent to a receiver that matches the service of the target device through the communication port.

[0011] In a second aspect, the present invention provides a device for parsing inter-device communication data, executed by a host device connected to peripheral devices, the device comprising:

[0012] The target parsing request acquisition module is used to acquire a target parsing request that matches the target device service when the target peripheral device is detected to trigger the execution of the target device service;

[0013] The target device parameter acquisition module is used to acquire target device parameters matching the target peripheral device by executing a target parsing file that matches the target parsing request;

[0014] The communication data monitoring module is used to obtain the communication port between the target peripheral device and the host device according to the target device parameters, and to pre-obtain communication data that matches the service of the target device through the communication port;

[0015] The parsing result sending module is used to parse the target data using a data parsing library that matches the parameters of the target device, and send the parsing result to a receiver that matches the service of the target device through the communication port.

[0016] Thirdly, the present invention provides an electronic device, the electronic device comprising:

[0017] At least one processor; and

[0018] A memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the device communication data parsing method according to any embodiment of the present invention.

[0020] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the method for parsing inter-device communication data as described in any embodiment of the present invention.

[0021] The technical solution of this invention, when a target peripheral device is detected to trigger the execution of a target device service, obtains a target parsing request matching the target device service, then executes a target parsing file matching the target parsing request to obtain target device parameters matching the target peripheral device, and obtains the communication port between the target peripheral device and the host device based on the target device parameters. Then, it pre-obtains communication data matching the target device service through the communication port, parses the target data using a data parsing library matching the target device parameters, and finally sends the parsing result to the receiver matching the target device service through the communication port. This solves the problem of low parsing efficiency of inter-device communication data in the prior art, realizes direct data communication between devices with various data formats, and improves the parsing efficiency of inter-device communication data with various data formats.

[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart of a method for parsing communication data between devices according to Embodiment 1 of the present invention;

[0025] Figure 2 This is a flowchart of a method for parsing communication data between devices according to Embodiment 2 of the present invention;

[0026] Figure 3 This is a schematic diagram of the structure of a device for parsing communication data between devices according to Embodiment 3 of the present invention;

[0027] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the method for parsing inter-device communication data according to an embodiment of the present invention. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0030] Example 1

[0031] Figure 1 This is a flowchart of a method for parsing inter-device communication data according to Embodiment 1 of the present invention. This embodiment is applicable to situations where a host device connects to a peripheral device and the host device performs the parsing of inter-device communication data. The method can be executed by an inter-device communication data parsing device, which can be implemented in hardware and / or software. The inter-device communication data parsing device can be configured in a host device connected to a peripheral device. The host device can be a terminal or server with the OpenHarmony framework and inter-device communication data parsing function.

[0032] Correspondingly, such as Figure 1 As shown, the method includes:

[0033] S110. When the target peripheral device is detected to trigger the execution of the target device service, a target parsing request matching the target device service is obtained.

[0034] The peripheral device includes: a hardware peripheral device with information exchange function and capable of establishing a communication connection with a host device with the OpenHarmony framework. For example, the peripheral hardware device can be a mobile hard drive with a USB interface, an e-reader, or a gamepad or monitor with a serial port.

[0035] In this embodiment, the target device service refers to the service functions of the target peripheral device. For example, if the main body of the target peripheral device is a portable hard drive, the service functions it can provide can be data storage and data transmission functions, and the target device service can be data storage service and data transmission service. Correspondingly, if the main body of the target peripheral device is a display, the service functions it can provide can be display functions, and the target device service can be data display service.

[0036] The target parsing request is a code request that matches the target device service and is used to exchange information with the host device. For example, if the main body of the target peripheral device is a portable hard drive and the currently acquired target device service is a data transmission service, then in this case, the host device sends a data transmission command to the target peripheral device as a parsing request to instruct the target peripheral device to complete the data transmission function.

[0037] S120. Obtain target device parameters that match the target peripheral device by executing the target parsing file that matches the target parsing request.

[0038] Specifically, after obtaining a target parsing request, the host device can directly match the target parsing file that matches the current target parsing request based on the format and information contained in the target parsing request. For example, the target parsing file can be a file with the format suffix (ini.), and by executing the target parsing file, the target device parameters in the target parsing file can be obtained. The target device parameters include: port location information for data communication between the host device and the target peripheral device, and configuration information for matching the port to the target parsing request configuration, etc.

[0039] In this embodiment, before obtaining the target device parameters matching the target peripheral device by executing the target parsing file that matches the target parsing request, the method further includes: parsing the file identifier of the target parsing file in the target parsing request; and obtaining the target parsing file that matches the target parsing request based on the file identifier.

[0040] The file identifier is a target parsing file that can identify a specific format suffix (ini.); furthermore, after obtaining the file identifier, the corresponding target parsing file with the format suffix (ini.) can be obtained based on the file identifier, that is, the target parsing file that matches the target parsing request.

[0041] S130. Based on the target device parameters, obtain the communication port between the target peripheral device and the host device, and pre-obtain communication data matching the target device service through the communication port.

[0042] The communication port is the port location where the host device and the target peripheral device exchange data. For example, if the target peripheral device is a portable hard drive a, and it is connected to the host device via USB in port 1 of the host device, then the communication port of the target peripheral device is port 1 - portable hard drive a port.

[0043] In this embodiment, taking the mobile hard drive a providing data transmission service as an example, since the data formats between the host device and the mobile hard drive are different, the data cannot be transmitted directly. Instead, the original data needs to be parsed into data that matches the mobile hard drive in the host device before transmission. When the host device receives a target parsing request for data transmission between the host device and the mobile hard drive a via port 1 - port a, the host device requests the mobile hard drive a to transmit data through the communication port. At this time, the mobile hard drive a calls the original data to be transmitted through the communication port. Afterwards, the host device listens to the data flowing through the communication port. At this time, the host device intercepts all the unparsed original data flowing through the communication port and caches it in the relay buffer, that is, it pre-acquires the communication data that matches the service of the target device through the communication port.

[0044] S140. The target data is parsed using a data parsing library that matches the parameters of the target device, and the parsing result is sent to a receiver that matches the service of the target device through the communication port.

[0045] The data parsing library is used to parse the target data into parsing result data that matches the receiver format of the target device service.

[0046] The receiver can be a host device or a peripheral device connected to the host device, depending on the content of the service provided by the target device. For example, if the current target device service is to store data into the portable hard drive a, then the current receiver is the portable hard drive. Correspondingly, if the current target device service is to retrieve data from the portable hard drive a and transfer it to the host device, then the current receiver is the host device.

[0047] In this embodiment, before parsing the target data using a data parsing library that matches the target device parameters, the method further includes: matching the target device parameters in a data parsing library set to obtain a data parsing library that matches the target device parameters; wherein the data parsing library set stores data parsing libraries corresponding to different types of peripheral devices.

[0048] The data parsing library set can be preset and adjusted manually.

[0049] The technical solution of this invention, when a target peripheral device is detected to trigger the execution of a target device service, obtains a target parsing request matching the target device service, then executes a target parsing file matching the target parsing request to obtain target device parameters matching the target peripheral device, and obtains the communication port between the target peripheral device and the host device based on the target device parameters. Then, it pre-obtains communication data matching the target device service through the communication port, parses the target data using a data parsing library matching the target device parameters, and finally sends the parsing result to the receiver matching the target device service through the communication port. This achieves direct data communication between devices with various data formats and improves the parsing efficiency of communication data between devices with various data formats.

[0050] Example 2

[0051] Figure 2 This is a flowchart of a method for parsing inter-device communication data according to Embodiment 2 of the present invention. This embodiment is a refinement based on the above embodiment. Specifically, this embodiment refines the method of sending the parsing result to a receiver matching the target device service through a communication port and the method of pre-acquiring communication data matching the target device service through a communication port. Specifically, it may include:

[0052] like Figure 2 As shown, the method includes:

[0053] S210. When the target peripheral device is detected to trigger the execution of the target device service, a target parsing request matching the target device service is obtained.

[0054] S220. By executing the target parsing file that matches the target parsing request, obtain the target device parameters that match the target peripheral device.

[0055] Before obtaining the target device parameters matching the target peripheral device by executing the target parsing file that matches the target parsing request, the method further includes: parsing the file identifier of the target parsing file in the target parsing request; and obtaining the target parsing file that matches the target parsing request based on the file identifier.

[0056] S230. Based on the target device parameters, obtain the communication port between the target peripheral device and the host device.

[0057] S240. Perform a port call test on the communication port and determine whether the communication port call was successful.

[0058] If so, then execute S250;

[0059] If not, then execute S260.

[0060] In this embodiment, since the current host device with the OpenHarmony framework and inter-device communication data parsing function has hot-plug functionality for peripheral devices, communication interface call failures may occur. For example, if the current peripheral device is a portable hard drive, and the portable hard drive is connected to the host device, and the host device generates a target parsing request for the portable hard drive, the host device executes a target parsing file matching the target parsing request, obtains target device parameters matching the target peripheral device, and obtains the communication port between the target peripheral device and the host device based on the target device parameters. If, during the process of the host device obtaining the communication port, the portable hard drive is manually unplugged without being unmounted, then the data port of the portable hard drive obtained by the host device is disconnected, resulting in a disconnected state, i.e., the port call fails.

[0061] S250, Pre-acquire communication data matching the target device service through the communication port, and execute S270.

[0062] Specifically, pre-acquiring communication data matching the target device service through the communication port includes: pre-acquiring segmented communication data matching the target device service through the communication port in segments, and caching each segmented communication data in the transit storage area.

[0063] In existing technologies, data transmission is usually done in a segmented manner, dividing large data into smaller data streams for transmission. That is, the communication data that the current host device listens to and is about to acquire is also segmented communication data. Furthermore, each segment of communication data can be pre-cached in the transit storage area of ​​the host device. The transit storage area can be a storage area with caching function contained in the host device.

[0064] S260, after a preset waiting time, return to execute S240.

[0065] The preset waiting time can be adjusted manually, such as 5 seconds.

[0066] S270. The target data is parsed in segments according to the pre-acquired time order to obtain the parsing results of each segment that matches the target data, and then S280 is executed.

[0067] In this embodiment, each target data is segmented and parsed according to the order of acquisition, using a data parsing library that matches the current target data format. It is easy to understand that since each segment of the target data is parsed independently, each segment of the target data has a matching segmented parsing result; wherein, the format of the segmented parsing result matches the format supported by the receiver of the target device service.

[0068] Specifically, after obtaining the segmented parsing results that match the target data, the process also includes:

[0069] The parsing results of each segment are assembled to obtain the parsing result, and the parsing result is sent to the receiver that matches the target device service.

[0070] In this embodiment, the parsing result can be a piece of stored data or command data to the receiver; further, if the parsing result is command data, the receiver executes the command sent by the sender to the receiver based on the command data; wherein, the content of the command data should match the target parsing request, that is, the command data can enable the receiver to execute the target device service.

[0071] S280. The parsing result is sent to the receiver that matches the target device service through the communication port.

[0072] The technical solution of this invention, when a target peripheral device is detected triggering the execution of a target device service, obtains a target parsing request matching the target device service. Then, by executing a target parsing file matching the target parsing request, target device parameters matching the target peripheral device are obtained. Based on the target device parameters, the communication port between the target peripheral device and the host device is obtained. The communication port then undergoes a port call test. If the port call test is successful, communication data matching the target device service is pre-acquired through the communication port. If the port call fails, after a preset waiting period, the operation of performing a port call test on the communication port is returned until the end-of-iteration condition is met. The target data is then parsed using a data parsing library matching the target device parameters. Finally, the parsing result is sent to the receiver matching the target device service through the communication port. This achieves direct data communication between devices with various data formats and improves the parsing efficiency of communication data between devices with various data formats.

[0073] Example 3

[0074] Figure 3 This is a schematic diagram of a device for parsing communication data between devices, provided in Embodiment 3 of the present invention.

[0075] like Figure 3 As shown, the device includes:

[0076] The target parsing request acquisition module 310 is used to acquire a target parsing request that matches the target device service when the target peripheral device is detected to trigger the execution of the target device service;

[0077] The target device parameter acquisition module 320 is used to acquire target device parameters matching the target peripheral device by executing a target parsing file that matches the target parsing request;

[0078] The communication data monitoring module 330 is used to obtain the communication port between the target peripheral device and the host device according to the target device parameters, and to pre-obtain communication data matching the target device service through the communication port;

[0079] The parsing result sending module 340 is used to parse the target data using a data parsing library that matches the parameters of the target device, and send the parsing result to a receiver that matches the service of the target device through the communication port.

[0080] The technical solution of this invention, when a target peripheral device is detected to trigger the execution of a target device service, obtains a target parsing request matching the target device service, then executes a target parsing file matching the target parsing request to obtain target device parameters matching the target peripheral device, and obtains the communication port between the target peripheral device and the host device based on the target device parameters. Then, it pre-obtains communication data matching the target device service through the communication port, parses the target data using a data parsing library matching the target device parameters, and finally sends the parsing result to the receiver matching the target device service through the communication port. This achieves direct data communication between devices with various data formats and improves the parsing efficiency of communication data between devices with various data formats.

[0081] Based on the above embodiments, it further includes: a target parsing file acquisition module, configured to: before acquiring target device parameters matching the target peripheral device by executing a target parsing file that matches the target parsing request, parse the file identifier of the target parsing file in the target parsing request; and acquire the target parsing file that matches the target parsing request based on the file identifier.

[0082] Based on the above embodiments, the communication data monitoring module 330 specifically includes:

[0083] The test unit is used to perform port call tests on the communication port;

[0084] A communication data acquisition unit is used to pre-acquire communication data that matches the service of the target device through the communication port;

[0085] The execution unit returns after a preset waiting period to perform a port call test on the communication port until the iteration end condition is met.

[0086] Based on the above embodiments, the communication data acquisition unit is further configured to:

[0087] The communication port is used to pre-acquire segmented communication data that matches the service of the target device, and each segmented communication data is cached in the transit storage area.

[0088] Based on the above embodiments, the parsing result sending module 340 is specifically used for:

[0089] The target data is segmented and parsed sequentially according to the pre-acquired time order to obtain the parsing results of each segment that matches the target data.

[0090] Based on the above embodiments, it may further include a parsing result sending module, used for:

[0091] After obtaining the parsing results of each segment that matches the target data, the parsing results of each segment are assembled to obtain the parsing result, and the parsing result is sent to the receiver that matches the target device service.

[0092] Based on the above embodiments, a data parsing library matching module may also be included, used for:

[0093] Before parsing the target data using a data parsing library that matches the target device parameters, a matching process is performed in a set of data parsing libraries based on the target device parameters to obtain a data parsing library that matches the target device parameters; wherein, the set of data parsing libraries stores data parsing libraries corresponding to different types of peripheral devices.

[0094] The device for parsing inter-device communication data provided in this embodiment of the invention can execute the method for parsing inter-device communication data provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0095] Example 4

[0096] Figure 4A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0097] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0098] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0099] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as methods for parsing inter-device communication data.

[0100] Accordingly, the method includes:

[0101] When a target peripheral device is detected to trigger the execution of a target device service, a target parsing request matching the target device service is obtained;

[0102] By executing the target parsing file that matches the target parsing request, the target device parameters that match the target peripheral device are obtained;

[0103] Based on the target device parameters, obtain the communication port between the target peripheral device and the host device, and pre-obtain communication data matching the target device service through the communication port;

[0104] The target data is parsed using a data parsing library that matches the parameters of the target device, and the parsing result is sent to a receiver that matches the service of the target device through the communication port.

[0105] In some embodiments, the method for parsing inter-device communication data may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for parsing inter-device communication data described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the method for parsing inter-device communication data by any other suitable means (e.g., by means of firmware).

[0106] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0107] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0108] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0109] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0110] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0111] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0112] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

Claims

1. A method for parsing inter-device communication data, executed by a host device connected to peripheral devices, characterized in that, include: When a target peripheral device is detected to trigger the execution of a target device service, a target parsing request matching the target device service is obtained; By executing the target parsing file that matches the target parsing request, the target device parameters that match the target peripheral device are obtained; Based on the target device parameters, obtain the communication port between the target peripheral device and the host device, and pre-obtain communication data matching the target device service through the communication port; The target data is parsed using a data parsing library that matches the parameters of the target device, and the parsing result is sent to a receiver that matches the service of the target device through the communication port. The process of pre-acquiring communication data matching the target device service through the communication port includes: performing a port call test on the communication port; if the port call test is successful, then pre-acquiring communication data matching the target device service through the communication port; if the port call fails, then after a preset waiting time, returning to perform the port call test on the communication port until the end of the iteration condition is met; wherein, pre-acquiring communication data matching the target device service through the communication port includes: pre-acquiring segmented communication data matching the target device service through the communication port, and caching each segmented communication data in the transit storage area; The process of parsing the target data using a data parsing library that matches the target device parameters includes: parsing the target data in segments according to the pre-acquired time order to obtain the parsing results of each segment that matches the target data; After obtaining the segmented parsing results that match the target data, the process also includes: The parsing results of each segment are assembled to obtain the parsing result, and the parsing result is sent to the receiver that matches the target device service.

2. The method according to claim 1, characterized in that, Before obtaining the target device parameters matching the target peripheral device by executing the target parsing file that matches the target parsing request, the method further includes: In the target parsing request, the file identifier of the target parsing file is parsed out; Based on the file identifier, obtain the target parsing file that matches the target parsing request.

3. The method according to claim 1, characterized in that, Before parsing the target data using a data parsing library that matches the target device parameters, the method further includes: Based on the target device parameters, a matching process is performed in the data parsing library set to obtain the data parsing library that matches the target device parameters; The data parsing library set stores data parsing libraries corresponding to different types of peripheral devices.

4. A device for parsing inter-device communication data, executed by a host device connected to peripheral devices, characterized in that, include: The target parsing request acquisition module is used to acquire a target parsing request that matches the target device service when the target peripheral device is detected to trigger the execution of the target device service; The target device parameter acquisition module is used to acquire target device parameters matching the target peripheral device by executing a target parsing file that matches the target parsing request; The communication data monitoring module is used to obtain the communication port between the target peripheral device and the host device according to the target device parameters, and to pre-obtain communication data that matches the service of the target device through the communication port; The parsing result sending module is used to parse the target data using a data parsing library that matches the parameters of the target device, and send the parsing result to a receiver that matches the service of the target device through the communication port; The communication data monitoring module includes: a testing unit for performing port call tests on the communication port; a communication data acquisition unit for pre-acquiring communication data matching the target device service through the communication port; and a return execution unit for returning to execute the port call test operation on the communication port after a preset waiting time interval, until the end of the iteration condition is met; wherein the communication data acquisition unit is used to: pre-acquire segmented communication data matching the target device service through the communication port, and cache each segmented communication data in a transit storage area; The parsing result sending module is used to: parse the target data into segments according to the pre-acquired time order, and obtain the parsing results of each segment that match the target data; The device for parsing inter-device communication data further includes a parsing result sending module, which is used to: after obtaining the parsing results of each segment that matches the target data, assemble the parsing results of each segment to obtain the parsing result, and send the parsing result to a receiver that matches the target device service.

5. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the method for parsing inter-device communication data according to any one of claims 1-3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the method for parsing inter-device communication data as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Data processing method based on big data and Internet of Things communication and cloud computing platform

    CN111917789A

  • Data calling method and device and electronic equipment

    CN111930534A