Equipment connection method and device, equipment, storage medium and product
By receiving and parsing the service data sent by smart hardware and using preset docking documents to handle abnormal services, the problem of abnormal connection between smart hardware and cloud is solved and the connection speed is improved.
Patent Information
- Application Number
- CN202411939984.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-03-25
AI Technical Summary
When connecting smart hardware to the cloud, due to the strong dependence of cloud services and device services, the hardware device logic module is inapplicable, and the connection abnormality occurs, resulting in slow communication connection.
By receiving the service data sent by the target device, analyzing the service data based on the preset connection protocol, and determining whether it is normal service data. If it does not belong to normal business data, the abnormal business will be processed through the preset docking document, and after the processing is completed, the connection will be established with the target device.
When the device connects abnormally to the cloud, abnormal services can be handled in time and improve the connection speed between the device and the cloud.
Smart Images

Figure CN119697233A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a device connection method, apparatus, device, storage medium and computer program product. Background Art
[0002] With the development of the Internet of Things, more and more hardware devices are connected to the cloud through communication modules, and all hardware can be connected and controlled. Based on this, more and more smart hardware has emerged, such as smart refrigerators, smart charging, etc.
[0003] During the use of smart hardware, the hardware needs to establish communication operations with the cloud. However, when actually communicating with the hardware device according to the protocol, due to the strong dependence between the cloud business and the device business, the hardware device logic module is not applicable when other hardware is connected to the cloud, so connection abnormalities will occur, resulting in slow communication between the cloud and the device.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide an invention name, aiming to solve the technical problems corresponding to the background technology.
[0006] To achieve the above object, the present application proposes a device connection method, the device connection method comprising: Receive business data sent by the target device; Based on a preset connection protocol, the service data is parsed to obtain service interaction information; Determining whether the service interaction information belongs to normal service data; If not, the abnormal business corresponding to the business interaction information is processed through a preset docking document. After the processing is completed, a connection is established with the target device. The preset docking document is used to process various abnormal business data during the device connection process.
[0007] In one embodiment, before the step of receiving the service data sent by the target device, the method further includes: Receive analog signals from the target device; Performing protocol verification on the analog signal to determine whether the protocol between the cloud and the target device is consistent; After determining that the protocol between the cloud and the target device is consistent, simulating an abnormal interaction signal in the target device based on the simulation signal to obtain a service processing solution; Based on the business processing solution, a preset docking document is generated.
[0008] In one embodiment, when the enumeration value of the simulated signal is not in the preset connection protocol, the step of simulating the abnormal interaction signal in the target device based on the simulated signal to obtain a service processing solution includes: Based on the simulation signal, construct a response signal containing an invalid enumeration value in the target device; After replacing the invalid enumeration value in the response signal with a preset default value or ignoring the invalid enumeration value, generating a processing result; When the processing result shows that the exception processing is completed, a business processing plan is generated.
[0009] In one embodiment, the step of parsing the service data based on the preset connection protocol to obtain the service interaction information includes: Based on the preset connection protocol, parsing the character string in the business data into a code object; Extracting the operation type corresponding to the code object; The processing function corresponding to the operation type is called, and the code object is parsed and processed by the processing function to obtain business interaction information.
[0010] In one embodiment, after the step of processing the abnormal business corresponding to the business interaction information by using the preset docking document, the method further includes: When it is detected that the preset docking document cannot handle the abnormal business, updating the preset docking document according to the business type corresponding to the abnormal business; The abnormal business is processed with the updated preset docking document, or the abnormal business is ignored, and the warning information corresponding to the abnormal business is reported.
[0011] In one embodiment, after the step of establishing a connection with the target device after the processing is completed, the method further includes: Sending a heartbeat signal to the target device at every preset time period to monitor the connection status of the target device; When it is determined that the connection state is an interrupted state, a connection instruction is sent to the target device to re-establish a connection with the target device.
[0012] In addition, to achieve the above-mentioned purpose, the present application also proposes a device connection device, the device connection device comprising: A first receiving module, used for receiving service data sent by a target device; A parsing module, used to parse the service data based on a preset connection protocol to obtain service interaction information; A judgment module, used to judge whether the business interaction information belongs to normal business data; A processing module is used to process the abnormal business corresponding to the business interaction information through a preset docking document if it does not belong to it, and establish a connection with the target device after the processing is completed. The preset docking document is used to process various abnormal business data during the device connection process.
[0013] In addition, to achieve the above-mentioned purpose, the present application also proposes a device connection device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the device connection method described above.
[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the device connection method described above are implemented.
[0015] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the device connection method described above are implemented.
[0016] The present application proposes a device connection method, apparatus, equipment, storage medium and computer program product. The present application receives business data sent by a target device, parses the business data based on the preset connection protocol, obtains business interaction information, and when it is determined that the business interaction information does not belong to normal business data, processes the abnormal business corresponding to the business interaction information through a preset docking document. After the processing is completed, a connection can be established with the target device. Since the preset docking document can process a variety of abnormal business data during the device connection process, when the device is abnormally connected to the cloud, the abnormal business that occurs can be processed in a timely manner to speed up the connection speed between the device and the cloud. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 A schematic diagram of a process flow provided for Embodiment 1 of the device connection method of the present application; Figure 2A schematic diagram of a flow chart provided for Embodiment 2 of the device connection method of the present application; Figure 3 This is a schematic diagram of the implementation process of the device connection method of this application; Figure 4 This is a schematic diagram of the module structure of the device connection device according to the embodiment of the present application; Figure 5 A schematic diagram of the device structure of the hardware operating environment involved in the device connection method in the embodiment of the present application.
[0020] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0021] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0022] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0023] The main solutions of the embodiments of this application are: Receive business data sent by the target device; Based on a preset connection protocol, the service data is parsed to obtain service interaction information; Determining whether the service interaction information belongs to normal service data; If not, the abnormal business corresponding to the business interaction information is processed through a preset docking document. After the processing is completed, a connection is established with the target device. The preset docking document is used to process various abnormal business data during the device connection process.
[0024] In the prior art, when the cloud and hardware devices communicate and connect according to the protocol, due to the strong dependence between the cloud business and the device business, the hardware device logic module is not applicable when other hardware is connected to the cloud, so connection abnormalities will occur, resulting in slow communication between the cloud and the device.
[0025] The present application proposes a device connection method, apparatus, equipment, storage medium and computer program product. The present application receives business data sent by a target device, parses the business data based on the preset connection protocol, obtains business interaction information, and when it is determined that the business interaction information does not belong to normal business data, processes the abnormal business corresponding to the business interaction information through a preset docking document. After the processing is completed, a connection can be established with the target device. Since the preset docking document can process a variety of abnormal business data during the device connection process, when the device is abnormally connected to the cloud, the abnormal business that occurs can be processed in a timely manner to speed up the connection speed between the device and the cloud.
[0026] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a device connection device, etc. The following takes the device connection device as an example to illustrate this embodiment and the following embodiments.
[0027] Based on this, the present application embodiment provides a device connection method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the device connection method of the present application.
[0028] In this embodiment, the device connection method includes steps S10 to S40: Step S10, receiving service data sent by the target device; It should be noted that the target device may be different devices for different application scenarios, wherein the target device may be a car, a refrigerator, a stereo, etc., without specific limitation.
[0029] It should be noted that the business data may be the business interaction data between the target device and the cloud. In the process of business interaction, multiple businesses may be generated. Taking the charging scenario as an example, the business data may be charging services, device connection instructions, and charging setting parameters, etc., without specific limitation.
[0030] Step S20, parsing the service data based on a preset connection protocol to obtain service interaction information; It should be noted that the preset connection protocol can be a network connection protocol between the target device and the cloud, for example, it can be an OCPP protocol, and the transmission architecture is websocket. OCPP (Open Charge Point Protocol) is an open standard protocol for communication between electric vehicle charging stations and central management systems. OCPP messages usually use the JSON format and include two parts: request and response.
[0031] It should be noted that the business data is the request data sent by the target device. The business data is parsed through the preset connection protocol. By extracting the business operations and business parameters, the business interaction required between the two can be determined, and then the business interaction information can be obtained.
[0032] In a feasible implementation manner, the step of parsing the service data based on the preset connection protocol to obtain the service interaction information includes: Based on the preset connection protocol, parsing the character string in the business data into a code object; Extracting the operation type corresponding to the code object; It should be noted that, by using the preset connection protocol, the character string in the business data is extracted, the character string is parsed into a code object (such as a JSON object), and the message ID, operation type, and data field are extracted from the JSON object. Depending on the type of operation, the parsed data can be further processed. For example, the startup information of the device can be recorded, or the status of the device can be updated.
[0033] The processing function corresponding to the operation type is called, and the code object is parsed and processed by the processing function to obtain business interaction information.
[0034] It should be noted that after determining the business operation type corresponding to the code object, the processing function corresponding to the operation type is called to parse the code object through the processing function and extract the business interaction information, thereby realizing effective communication between the device and the cloud system.
[0035] Step S30, determining whether the service interaction information belongs to normal service data; It should be noted that the business interaction information can be normal business data or abnormal business data. When the business interaction information belongs to normal business data, the target device and the cloud can be connected normally without the need for abnormal business processing. When the business interaction information does not belong to normal business data, abnormal business processing is required before the connection between the device and the cloud can be established normally.
[0036] Step S40: If it does not belong, the abnormal business corresponding to the business interaction information is processed through a preset docking document. After the processing is completed, a connection is established with the target device. The preset docking document is used to process various abnormal business data during the device connection process.
[0037] It should be noted that the preset docking document includes protocol specifications, the format of each signal, how to establish a communication connection, and how to handle abnormal services, such as timeouts and network interruptions. When abnormal services corresponding to business interaction information are identified, the corresponding business processing solutions can be called to handle them, thereby ensuring normal connection between the device and the cloud.
[0038] It should be noted that the process of processing the abnormal business corresponding to the business interaction information through the preset docking document may be: Identify abnormal business in the interactive data; based on the abnormal business, call the business processing solution in the preset docking document; based on the business processing solution, process the abnormal business, and after the processing is completed, establish a connection with the target device.
[0039] Among them, abnormal business includes: 1. The hardware device did not return the expected signal.
[0040] 2. The enumeration value in the A signal returned by the hardware device is not defined in the protocol.
[0041] 3. Hardware device response timeout.
[0042] 4. The network connection is interrupted.
[0043] Abnormal business can be handled in the following ways: 1. Record logs, send retry requests, or take other measures based on business logic.
[0044] 2. Record the log and send a confirmation request, asking the device to resend the correct signal.
[0045] 3. Record logs, send retry requests, and set a reasonable timeout.
[0046] 4. Record logs, try to re-establish the connection, and use the heartbeat mechanism to keep the connection active.
[0047] In a feasible implementation manner, after the step S40 of processing the abnormal business corresponding to the business interaction information by using the preset docking document, the method further includes: When it is detected that the preset docking document cannot handle the abnormal business, updating the preset docking document according to the business type corresponding to the abnormal business; It should be noted that most of the solutions for handling abnormal business are included in the preset docking document. When the preset docking document cannot solve the abnormal business, it is necessary to update the preset docking document according to the business type of the abnormal business. The updating method can be that technical personnel analyze and process the abnormal business to obtain a new solution, and then store the new solution in the preset docking document.
[0048] The abnormal business is processed with the updated preset docking document, or the abnormal business is ignored, and the warning information corresponding to the abnormal business is reported.
[0049] It should be noted that the abnormal business is processed with the updated preset docking document to ensure that the preset docking document can handle the abnormal business normally. It is also possible to ignore the processing steps of the abnormal business, establish a connection between the target device and the cloud, and report the warning information corresponding to the abnormal business to the user end, so that technical personnel can handle the abnormal business in a timely manner.
[0050] In a feasible implementation manner, after the step S40 of establishing a connection with the target device after the processing is completed, the method further includes: Sending a heartbeat signal to the target device at every preset time period to monitor the connection status of the target device; It should be noted that the preset time period can be 10S, 30S, etc., and can be changed according to user needs without specific limitation.
[0051] It should be noted that the heartbeat mechanism is used to keep the connection active, send heartbeat signals regularly, monitor the connection status between the target device and the cloud, and immediately try to re-establish the connection once the connection is interrupted.
[0052] When it is determined that the connection state is an interrupted state, a connection instruction is sent to the target device to re-establish a connection with the target device.
[0053] It should be noted that when it is determined that the connection state is an interrupted state, a connection instruction is immediately sent to the target device, so as to re-establish a connection with the target device.
[0054] The present application proposes a device connection method, apparatus, equipment, storage medium and computer program product. The present application receives business data sent by a target device, parses the business data based on the preset connection protocol, obtains business interaction information, and when it is determined that the business interaction information does not belong to normal business data, processes the abnormal business corresponding to the business interaction information through a preset docking document. After the processing is completed, a connection can be established with the target device. Since the preset docking document can process a variety of abnormal business data during the device connection process, when the device is abnormally connected to the cloud, the abnormal business that occurs can be processed in a timely manner to speed up the connection speed between the device and the cloud.
[0055] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , before the step of receiving the service data sent by the target device, it also includes: steps S01~S04: Step S01, receiving an analog signal from a target device; It should be noted that before the target device performs a service connection, it is necessary to receive an analog signal of the target device, wherein the analog signal is used to simulate an abnormal service scenario that may occur in the target device.
[0056] Step S02, performing protocol verification on the analog signal to determine whether the protocol between the cloud and the target device is consistent; It should be noted that before the connection is made, the protocol between the target device and the cloud is verified through an analog signal sent by the target device. Only when the protocols of the two are consistent can the connection be established. When the protocols of the two are inconsistent, data cannot be sent to each other.
[0057] Step S03, after determining that the protocol between the cloud and the target device is consistent, based on the simulation signal, simulate the abnormal interaction signal in the target device to obtain a service processing solution; It should be noted that after confirming that the protocol between the cloud and the target device is consistent, the abnormal business scenario of the target device is simulated by simulating the signal. The abnormal business scenario can be simulated by simulating the abnormal interaction signal, and then processing the abnormal interaction signal to obtain the corresponding business processing solution.
[0058] Step S04: Generate a preset docking document based on the business processing solution.
[0059] It should be noted that for each simulation signal, an abnormal business scenario of the target device can be simulated. In the process of generating a preset docking document, multiple simulation signals of the target device can be received to simulate multiple abnormal interaction signals, and then multiple business processing solutions can be generated. After integrating and storing each business processing solution, a preset docking document can be generated.
[0060] In a feasible implementation manner, when the enumeration value of the simulated signal is not in the preset connection protocol, the step S03 of simulating the abnormal interaction signal in the target device based on the simulated signal to obtain the service processing solution includes: Based on the simulation signal, construct a response signal containing an invalid enumeration value in the target device; It should be noted that when an analog signal of a target device is received, if the enumeration definition in the analog signal is not in the protocol definition, a response signal containing an invalid enumeration value in the target device is constructed through the analog signal.
[0061] After replacing the invalid enumeration value in the response signal with a preset default value or ignoring the invalid enumeration value, generating a processing result; It should be noted that invalid enumeration values are replaced by preset default values to ensure that the system continues to run, or after ignoring invalid enumeration values, the next step of business processing can be guaranteed to run normally and then generate processing results.
[0062] When the processing result shows that the exception processing is completed, a business processing plan is generated.
[0063] It should be noted that when the processing result shows that the exception processing is completed, the processing plan is recorded and a corresponding business processing plan is generated.
[0064] It should be noted that the business processing solution may also be: 1. Record invalid values and their timestamps in a log file for later analysis.
[0065] 2. Send alerts or notifications to relevant personnel so that the problem can be handled in a timely manner.
[0066] In this embodiment, by receiving an analog signal from a target device and processing abnormal business scenarios of the target device with the analog signal, a docking document containing multiple business processing solutions is generated, thereby ensuring abnormal business processing during the connection between the device and the cloud.
[0067] For example, to help understand the implementation process of the device connection method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 3 , Figure 3A schematic diagram of an implementation flow of a device connection method is provided, specifically: By defining the connection between the target device and the cloud, building a connection protocol (configuring the response string), parsing the signal of the target device through the cloud, determining whether the numerical value is parsed correctly and whether the value is correct, and then constructing the data logic that conforms to the scenario, for example, when constructing a scenario where the cloud sends a charging signal and the hardware does not respond within 2 minutes, the logic is changed, setting the thread to sleep for 2 minutes, and then giving the corresponding ACK response processing solution, thereby completing the robustness check of the cloud, and then establishing the connection between the cloud and the target device.
[0068] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the device connection method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0069] This application also provides a device connection device, please refer to Figure 4 , the device connection device comprises: A first receiving module 10, used to receive service data sent by a target device; The parsing module 20 is used to parse the service data based on a preset connection protocol to obtain service interaction information; A judging module 30 is used to judge whether the service interaction information belongs to normal service data; The processing module 40 is used to process the abnormal business corresponding to the business interaction information through a preset docking document if it does not belong to it, and establish a connection with the target device after the processing is completed. The preset docking document is used to process various abnormal business data during the device connection process.
[0070] Optionally, the device further comprises: A second receiving module, used for receiving an analog signal from a target device; A verification module, used to perform protocol verification on the analog signal to determine whether the protocol between the cloud and the target device is consistent; A simulation module, configured to simulate an abnormal interaction signal in the target device based on the simulation signal after determining that the protocol between the cloud and the target device is consistent, and obtain a service processing solution; A generation module is used to generate a preset docking document based on the business processing solution.
[0071] Optionally, the simulation module includes: A construction unit, configured to construct a response signal containing an invalid enumeration value in the target device based on the simulation signal; A first generating unit, configured to replace the invalid enumeration value in the response signal with a preset default value or ignore the invalid enumeration value, and then generate a processing result; The second generating unit is used to generate a business processing solution when the processing result shows that the exception processing is completed.
[0072] Optionally, the parsing module includes: A parsing unit, configured to parse a character string in the service data into a code object based on the preset connection protocol; An extraction unit, used for extracting an operation type corresponding to the code object; The processing unit is used to call the processing function corresponding to the operation type, and parse the code object through the processing function to obtain business interaction information.
[0073] Optionally, the device further comprises: An updating module, configured to update the preset docking document according to the business type corresponding to the abnormal business when it is detected that the preset docking document cannot handle the abnormal business; The reporting module is used to process the abnormal business with the updated preset docking document, or ignore the abnormal business, and report the warning information corresponding to the abnormal business.
[0074] Optionally, the device further comprises: A sending module, used for sending a heartbeat signal to the target device at every preset time period to monitor the connection status of the target device; The connection module is used to send a connection instruction to the target device to re-establish a connection with the target device when determining that the connection state is an interrupted state.
[0075] The device connection device provided by the present application adopts the device connection method in the above embodiment, which can solve the technical problem of device connection. Compared with the prior art, the beneficial effects of the device connection device provided by the present application are the same as the beneficial effects of the device connection method provided by the above embodiment, and other technical features in the device connection device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0076] The present application provides a device connection device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the device connection method in the above-mentioned embodiment one.
[0077] Reference below Figure 5, which shows a schematic diagram of the structure of a device connection device suitable for implementing an embodiment of the present application. The device connection device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The device connection device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0078] like Figure 5 As shown, the device connection device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the device connection device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the device connection device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a device connection device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0079] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0080] The device connection device provided by the present application adopts the device connection method in the above embodiment to solve the technical problem of device connection. Compared with the prior art, the beneficial effects of the device connection device provided by the present application are the same as the beneficial effects of the device connection method provided by the above embodiment, and other technical features in the device connection device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0081] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0082] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0083] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the device connection method in the above-mentioned embodiment.
[0084] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0085] The computer-readable storage medium may be included in the device connection device; or may exist independently without being assembled into the device connection device.
[0086] The computer-readable storage medium carries one or more programs, and when the one or more programs are executed by the device-to-device connection, the device-to-device connection: Receive business data sent by the target device; Based on a preset connection protocol, the service data is parsed to obtain service interaction information; Determining whether the service interaction information belongs to normal service data; If not, the abnormal business corresponding to the business interaction information is processed through a preset docking document. After the processing is completed, a connection is established with the target device. The preset docking document is used to process various abnormal business data during the device connection process.
[0087] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0088] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0089] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0090] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned device connection method, and can solve the technical problem of device connection. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the device connection method provided in the above-mentioned embodiment, and will not be described in detail here.
[0091] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned device connection method when executed by a processor.
[0092] The computer program product provided by the present application can solve the technical problem of device connection. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the device connection method provided by the above embodiment, which will not be repeated here.
[0093] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A device connection method, characterized in that: Applied to the cloud, the method includes: Receive business data sent by the target device; Based on a preset connection protocol, the service data is parsed to obtain service interaction information; Determining whether the service interaction information belongs to normal service data; If not, the abnormal business corresponding to the business interaction information is processed through a preset docking document. After the processing is completed, a connection is established with the target device. The preset docking document is used to process various abnormal business data during the device connection process.
2. The method according to claim 1, characterized in that Before the step of receiving the service data sent by the target device, the method further includes: Receive analog signals from the target device; Performing protocol verification on the analog signal to determine whether the protocol between the cloud and the target device is consistent; After determining that the protocol between the cloud and the target device is consistent, simulating an abnormal interaction signal in the target device based on the simulation signal to obtain a service processing solution; Based on the business processing solution, a preset docking document is generated.
3. The method according to claim 2, characterized in that In the case that the enumeration value of the simulated signal is not in the preset connection protocol, the step of simulating the abnormal interaction signal in the target device based on the simulated signal to obtain a service processing solution includes: Based on the simulation signal, construct a response signal containing an invalid enumeration value in the target device; After replacing the invalid enumeration value in the response signal with a preset default value or ignoring the invalid enumeration value, generating a processing result; When the processing result shows that the exception processing is completed, a business processing plan is generated.
4. The method according to claim 1, characterized in that The step of parsing the service data based on the preset connection protocol to obtain the service interaction information includes: Based on the preset connection protocol, parsing the character string in the business data into a code object; Extracting the operation type corresponding to the code object; The processing function corresponding to the operation type is called, and the code object is parsed and processed by the processing function to obtain business interaction information.
5. The method according to claim 1, characterized in that After the step of processing the abnormal business corresponding to the business interaction information by using the preset docking document, the method further includes: When it is detected that the preset docking document cannot handle the abnormal business, updating the preset docking document according to the business type corresponding to the abnormal business; The abnormal business is processed with the updated preset docking document, or the abnormal business is ignored, and the warning information corresponding to the abnormal business is reported.
6. The method according to claim 1, characterized in that After the processing is completed, after the step of establishing a connection with the target device, the step further includes: Sending a heartbeat signal to the target device at every preset time period to monitor the connection status of the target device; When it is determined that the connection state is an interrupted state, a connection instruction is sent to the target device to re-establish a connection with the target device.
7. A device connection device, characterized in that: The device comprises: A first receiving module, used for receiving service data sent by a target device; A parsing module, used to parse the service data based on a preset connection protocol to obtain service interaction information; A judgment module, used to judge whether the business interaction information belongs to normal business data; A processing module is used to process the abnormal business corresponding to the business interaction information through a preset docking document if it does not belong to it, and establish a connection with the target device after the processing is completed. The preset docking document is used to process various abnormal business data during the device connection process.
8. A device connecting device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the device connection method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the device connection method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the device connection method according to any one of claims 1 to 6 are implemented.