Information processing method, device, electronic device and computer readable storage medium
By receiving and converting the control information of the device, it solves the problem of communication protocol differences between smart devices, achieves efficient control between devices with different data protocols, and reduces R&D costs and debugging cycles.
Patent Information
- Application Number
- CN202210141524.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-16
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2042-02-16
AI Technical Summary
Due to differences in communication protocols between smart devices produced by different manufacturers, the efficiency of device docking is low, which increases R&D costs and debugging cycles.
By receiving the control information of the device and converting it into control information adapted to different data protocols according to the preset data protocol conversion relationship, communication and control between different devices are realized.
It achieves efficient control processing between devices with different data protocols, reduces R&D costs and debugging cycles, and improves device docking efficiency.
Smart Images

Figure CN114513561B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology. Specifically, the present application relates to an information processing method, device, electronic device and computer-readable storage medium. Background Art
[0002] With the rapid development of the mobile Internet industry and the Internet of Things industry, people's lives have entered the era of intelligence, and various smart devices have emerged in an endless stream, providing users with a variety of smart services. In the process of using smart devices, multiple devices usually need to interact with each other, that is, to communicate and connect devices produced by different manufacturers. However, there are often differences in communication protocols between devices, such as devices produced by different manufacturers, and different types of devices generated by the same manufacturer. In order to solve the problem of communication protocol differences, it is usually necessary to invest a lot of R&D resources to achieve protocol connection between different devices, which increases R&D costs and prolongs the device debugging cycle, affecting the use of the device. Summary of the invention
[0003] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defect of low efficiency of device docking.
[0004] According to one aspect of the present application, there is provided an information processing method, the method comprising: receiving first control information for a second device;
[0005] According to a preset data protocol conversion relationship, converting the first control information into second control information; wherein the data protocol conversion relationship is a conversion relationship between a first data protocol of the first device and a second data protocol of the second device;
[0006] The second control information is sent to the second device.
[0007] Optionally, before receiving the first control information for the second device, the method further includes:
[0008] The data protocol conversion relationship is determined.
[0009] Optionally, determining the data protocol conversion relationship includes:
[0010] Acquire third control information for the second device;
[0011] converting the third control information according to the first data protocol and the second data protocol to obtain fourth control information;
[0012] The data protocol conversion relationship is obtained according to the corresponding relationship between the third control information and the fourth control information.
[0013] Optionally, converting the third control information according to the first data protocol and the second data protocol to obtain fourth control information includes:
[0014] Parsing the third control information according to the second data protocol to obtain a first identifier and a second identifier in the third control information; the first identifier includes an identifier of a target object of the third control information, and the second identifier includes an identifier of a target operation for the target object;
[0015] According to the first data protocol, the first identifier and the second identifier are encapsulated to obtain fourth control information.
[0016] Optionally, the acquiring third control information for the second device includes:
[0017] parsing the preset control information of the second device according to the second data protocol to obtain the third control information;
[0018] and / or
[0019] The third control information is generated according to a preset control event of the second device and the second data protocol.
[0020] Optionally, receiving first control information for the second device includes:
[0021] receiving first operation information corresponding to a first control event, where the first operation information includes a target object corresponding to the first control event and a target operation for the target object;
[0022] First control information is determined according to a target object corresponding to the first control event and a target operation for the target object.
[0023] Optionally, the first control event includes at least one of the following:
[0024] a component control event of the second device;
[0025] A status query event of the second device;
[0026] a control data query event of the second device;
[0027] A test event for the second device.
[0028] According to one aspect of the present application, there is provided an information processing method, the method comprising:
[0029] receiving a triggering operation of a first control event, and determining first operation information, wherein the first operation information includes a target object corresponding to the first control event and a target operation for the target object;
[0030] The first operation information is sent to a first device, wherein a data protocol conversion relationship exists between a first data protocol of the first device and a second data protocol of the second device.
[0031] According to another aspect of the present application, there is provided an information processing device, the device comprising:
[0032] A receiving module, configured to receive first control information for a second device;
[0033] A conversion module, configured to convert the first control information into second control information according to a preset data protocol conversion relationship; wherein the data protocol conversion relationship is a conversion relationship between a first data protocol of the first device and a second data protocol of the second device;
[0034] A sending module is used to send the second control information to the second device.
[0035] According to another aspect of the present application, there is provided an information processing device, the device comprising:
[0036] a determination module, configured to receive a trigger operation of a first control event and determine first operation information, wherein the first operation information includes a target object corresponding to the first control event and a target operation for the target object;
[0037] The sending module is used to send the first operation information to the first device, wherein a data protocol conversion relationship exists between the first data protocol of the first device and the second data protocol of the second device.
[0038] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:
[0039] one or more processors;
[0040] Memory;
[0041] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to: execute any one of the information processing methods shown in the first aspect of the present application.
[0042] For example, in a third aspect of the present application, a computing device is provided, including: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0043] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the information processing method shown in the first aspect of the present application.
[0044] According to another aspect of the present application, a computer-readable storage medium is provided, and when the computer program is executed by a processor, any information processing method shown in the first aspect of the present application is implemented.
[0045] For example, the fourth aspect of an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the information processing method shown in the first aspect of the present application is implemented.
[0046] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the first aspect above.
[0047] The beneficial effects of the technical solution provided by this application are:
[0048] The embodiment of the present application receives first control information from a second device, converts the first control information into second control information according to a preset data protocol conversion relationship, and then sends the second control information to the second device, thereby realizing control processing by the first device on the second device having a different data protocol with the first device. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0050] Figure 1 A flowchart of an information processing method provided in an embodiment of the present application;
[0051] Figure 2 A schematic diagram of information interaction of an information processing method provided in an embodiment of the present application;
[0052] Figure 3 A flowchart of an information processing method provided in an embodiment of the present application;
[0053] Figure 4 A schematic diagram of the structure of an information processing device provided in an embodiment of the present application;
[0054] Figure 5 A schematic diagram of the structure of an information processing device provided in an embodiment of the present application;
[0055] Figure 6 A schematic diagram of the structure of an electronic device for information processing provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0057] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0058] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0059] In the process of using smart devices, multiple devices usually need to interact with each other, that is, to communicate and connect devices produced by different manufacturers. However, there are often differences in communication protocols between devices, such as devices produced by different manufacturers, different types of devices generated by the same manufacturer, etc. In order to solve the problem of communication protocol differences, it is usually necessary to invest a lot of R&D resources to achieve protocol connection between different devices, which increases R&D costs and prolongs the device debugging cycle, affecting the use of the device. The information processing method, device, electronic device and computer-readable storage medium provided in this application are intended to solve the above technical problems of the prior art.
[0060] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0061] The solution provided in the embodiments of the present application can be executed by any electronic device, such as a terminal device or a server, wherein the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here. For the technical problems existing in the prior art, the information processing method, device, electronic device and storage medium provided in this application are intended to solve at least one of the technical problems of the prior art.
[0062] The present application embodiment provides a possible implementation method, such as Figure 1 As shown, a flowchart of an information processing method is provided, which can be executed by any electronic device. Optionally, the method is applied to a first device, which can be a server or a terminal device. For the convenience of description, the method provided in the embodiment of the present application is described below using the server as the execution subject.
[0063] The embodiments of the present application can be applied to the field of Internet technology. Between a first device and a second device with different data protocols, the first device receives first control information from the second device, converts the first control information into second control information according to a preset data protocol conversion relationship, and then sends the second control information to the second device, thereby realizing the control processing of the first device on the second device with a different data protocol.
[0064] Specifically, Figure 1 As shown, the information processing method of the embodiment of the present application may include the following steps:
[0065] S101: Receive first control information for a second device;
[0066] The first device may be a device control server or other control tool or device. For ease of description, the method is applied to a device control server (hereinafter referred to as a server) as an example. The first device may communicate with multiple second devices.
[0067] Specifically, the second device includes a device having a different data protocol from the first device. For example, the data protocol of the first device is protocol a, and the data protocol of the second device is protocol b. In this case, when the first device and the second device have different data protocols, when the first device and the second device need to communicate, the information processing method provided in the embodiment of the present application can be used to implement information interaction or instruction interaction between the two devices.
[0068] Optionally, the second device may include a server device or a terminal device.
[0069] The first control information may be used to indicate control information corresponding to a control event, and the control event includes an event for controlling a second device; optionally, the first control information may include control instruction information corresponding to the control event, and the first control information is control information in a protocol format using a data protocol of the first device. For ease of description, the data protocol corresponding to the subsequent first device may be referred to as a first data protocol, the data protocol corresponding to the second device may be referred to as a second data protocol, and the control event for the second device may be referred to as a first control event, but this does not constitute a limitation on the embodiments of the present application.
[0070] Optionally, the first control event may include the following situations 1 to 4:
[0071] Case 1: The first control event may include a control event for controlling a device component of the second device. For example, a control event for controlling a device component of the second device to perform a corresponding action; taking the second device as a smart locker as an example, the device components may be a door, a lighting lamp, etc. of the smart locker. Accordingly, the first control event may include controlling to open a compartment door of the smart locker, turn on a lighting lamp, etc.
[0072] Case 2: The first control event may include a control event for querying the status of the second device. For example, querying the action status of a device component of the second device, querying the fault status of the second device, etc. Taking the second device as a smart access cabinet as an example, the first control event may include querying whether the door of the access compartment of the smart access cabinet is open, whether the lighting is turned on, etc.
[0073] Case 3: The first control event may include a control event for querying the control data of the second device, such as querying the fault data of the smart locker, querying the device identification of the smart locker, etc.
[0074] Case 4: the first control event may include a control event for testing the second device.
[0075] In addition, the first control information may be acquired by receiving a triggering operation of a first control event on the second device.
[0076] Optionally, in an embodiment of the present application, the second device may be a terminal device, which may include a variety of devices. For example, the terminal device may include a smart phone, a tablet computer, a laptop computer, a smart speaker, a smart watch, a smart locker, etc.; the following is an exemplary description taking the terminal device as a smart locker as an example.
[0077] As an example 1, the first device may be a server device that controls and schedules the smart access cabinet, and the second device may be a smart access cabinet corresponding to a different data protocol from the first device. In this example, the user may trigger the first control event of opening access compartment No. 1 by scanning a code or other triggering operations. The server receives the triggering operation, and identifies that the first control event corresponding to the triggering operation is opening the cabinet door of access compartment No. 1, and, for the triggering operation, the first control event corresponding to the triggering operation is associated with opening the door of access compartment No. 1 and also with opening the lighting of access compartment No. 1.
[0078] Furthermore, the server may obtain a control instruction corresponding to the first control event of opening the cabinet door of access slot No. 1 and turning on the lighting of access slot No. 1 according to the first control event of controlling opening the cabinet door of access slot No. 1 and turning on the lighting of access slot No. 1.
[0079] Optionally, the server can obtain the control instruction corresponding to the first control event from the control information list of the second device, that is, the control instruction list of all control events of the second device. When obtaining the control instruction corresponding to the above-mentioned first control event, the control object in the first control event can be determined first, that is, the control object of the first control event is the cabinet door and the lighting of access slot No. 1; then, the control operation for the control object is determined, that is, opening the cabinet door of access slot No. 1 and turning on the lighting; then, according to the above-mentioned control object and control operation, the control instruction corresponding to the first event is obtained from the control instruction list corresponding to the second device, that is, the first control information corresponding to the first control event.
[0080] It should be noted that the above-mentioned first control information is control information corresponding to the first data protocol.
[0081] S102: Convert the first control information into second control information according to a preset data protocol conversion relationship.
[0082] The data protocol conversion relationship is a conversion relationship between a first data protocol of the first device and a second data protocol of the second device.
[0083] After receiving the first control information of the second device, since the first control information is control information corresponding to the first data protocol, and the second device corresponds to the second data protocol, in the case where the data protocols corresponding to the first device and the second device are different, if it is necessary to implement information interaction between the first device and the second device, that is, to implement the control of the second device by the first device, the first control information can be converted into the second control information according to the preset data protocol conversion relationship. The second control information includes the control information corresponding to the second data protocol.
[0084] The preset data protocol conversion relationship may include a data address conversion relationship, a data format conversion relationship, a data content conversion relationship, a data length conversion relationship, etc. in the first control information and the second control information.
[0085] It can be understood that, according to the preset data protocol conversion relationship, the first control information is converted into second control information that complies with the second data protocol of the second device, so that the first device can control the second device with a different data protocol.
[0086] S103: Send the second control information to the second device.
[0087] After converting the first control information into the second control information, the second control information may be sent to the second device, so that after receiving the second control information conforming to its corresponding second data protocol, the second device executes the corresponding first control event according to the second control information.
[0088] For example, in Example 1, the user triggers the opening of access slot 1 by scanning a code, and the server receives the trigger operation and identifies the first control event corresponding to the trigger operation as opening access slot 1 and turning on the lighting of access slot 1. After the first control information is converted into the second control information through the above steps of the embodiment of the present application and the second control information is sent to the second device, i.e., the smart access cabinet, the smart access cabinet can be controlled to open access slot 1 and turn on the lighting of access slot 1.
[0089] The embodiment of the present application receives first control information from a second device, converts the first control information into second control information according to a preset data protocol conversion relationship, and then sends the second control information to the second device, thereby realizing control processing by the first device on the second device having a different data protocol with the first device.
[0090] In another embodiment of the present application, before receiving the first control information for the second device, the method further includes:
[0091] The data protocol conversion relationship is determined.
[0092] Specifically, for example, in Example 1, before receiving the first control information for the first control event of the smart control cabinet, the server can first determine the data protocol conversion relationship between the first data protocol corresponding to the server side and the second data protocol corresponding to the smart access cabinet side, so as to convert the first control information into the second control information when the smart control cabinet is subsequently controlled.
[0093] In another embodiment of the present application, determining the data protocol conversion relationship includes:
[0094] Acquire third control information for the second device;
[0095] converting the third control information according to the first data protocol and the second data protocol to obtain fourth control information;
[0096] The data protocol conversion relationship is obtained according to the corresponding relationship between the third control information and the fourth control information.
[0097] In the embodiment of the present application, the third control information is used to represent the control information of any control event for the second device, and the third control information is the control information corresponding to the second data protocol, that is, the third control information can be the control information of any control event that complies with the second data protocol corresponding to the second device. Correspondingly, the fourth control information is used to represent the control information of any control event corresponding to the first data protocol, that is, the fourth control information can be the control information of any control event that complies with the first data protocol corresponding to the first device.
[0098] It can be understood that when determining the data protocol conversion relationship, the data protocol conversion relationship can be obtained by determining the corresponding relationship between the third control information and the fourth control information of each control event.
[0099] It should be noted that the third control information in the embodiment of the present application may correspond to the second control information, and both the third control information and the second control information are control information that adopt the second control protocol; the fourth control information may correspond to the first control information, and both the fourth control information and the first control information are control information that adopt the first control protocol. Among them, the third control information and the fourth control information are used to indicate the control information corresponding to any control event when determining the data protocol conversion relationship; the first control information and the second control information are used to indicate the control information corresponding to the first control event when the second device is in the application stage, for example, when the smart locker is actually used, it receives the trigger operation of the first control event. Therefore, the first control information and the third control information, the second control information and the fourth control information are just different identifiers at different application stages, and they cannot be understood as limitations of different control information.
[0100] Optionally, in another embodiment of the present application, the acquiring third control information for the second device may include:
[0101] parsing the preset control information of the second device according to the second data protocol to obtain the third control information;
[0102] and / or
[0103] The third control information is generated according to a preset control event of the second device and the second data protocol.
[0104] Specifically, the third control information can be obtained in the following ways:
[0105] Method 1: Obtained by parsing preset control information of the second device.
[0106] Specifically, the preset control information of the second device may include control information of all control events of the second device, and the preset control information is control information that complies with the second data protocol. For example, the preset control information of the second device may include control information for controlling device components of the second device, control information for querying the fault status of the second device, control information for testing the second device, etc. The preset control information of the second device may be obtained from the second device when communicating with the second device.
[0107] Furthermore, the preset control information of the second device may be parsed according to the second data protocol to obtain control information corresponding to each control event in the preset control information. Specifically, the control information may include control instruction information corresponding to each control event.
[0108] When parsing, the second data protocol can be used to indicate the control object information, control operation information, and data type, data address, data length, data packet number, etc. corresponding to each control event. As an example, the specific content of the second data protocol can be found in Table 1. For example, referring to Table 1, the "address" field is "0x01", the placeholder is the first bit, and the type is "BYTE".
[0109]
[0110]
[0111] Table 1
[0112] Therefore, it can be understood that, according to the second data protocol, the preset control information of the second device can be parsed to obtain the third control information corresponding to each control event of the second device.
[0113] Method 2: As another method, the third control information may also be pre-generated according to the second data protocol.
[0114] Specifically, all control events corresponding to the second device may be determined in advance, for example, all control events corresponding to the second device may be listed, and then third control information corresponding to each control event may be generated in advance according to the second data protocol corresponding to the second device.
[0115] Optionally, in another embodiment of the present application, converting the third control information according to the first data protocol and the second data protocol to obtain fourth control information includes:
[0116] Parsing the third control information according to the second data protocol to obtain a first identifier and a second identifier in the third control information; the first identifier includes an identifier of a target object of the third control information, and the second identifier includes an identifier of a target operation for the target object;
[0117] According to the first data protocol, the first identifier and the second identifier are encapsulated to obtain fourth control information.
[0118] Optionally, the third control information may be control instruction information for any control event of the second device that complies with the second data protocol. According to the second data protocol, the third control information is parsed to obtain the first identifier and the second identifier in the third control information. The first identifier may be an identifier of a target object in the control instruction information, wherein the target object may be a control object corresponding to the control event; the second identifier may be an identifier of a target operation for the target object in the control instruction information, wherein the target operation may be a control operation corresponding to the control event.
[0119] After obtaining the identifier of the target object of the third control information and the identifier of the target operation for the target object, in order to convert them into control information that complies with the first data protocol corresponding to the first device, the first identifier and the second identifier can be encapsulated according to the first data protocol to obtain fourth control information corresponding to the first data protocol.
[0120] In combination with Example 1, in Example 1, the first control event includes opening the cabinet door of access compartment No. 1 and turning on the lighting of access compartment No. 1. In the first event, the control object, that is, the target object, includes the cabinet door of access compartment No. 1 and the lighting of access compartment No. 1; the control operation for the target object is an opening operation, that is, opening the cabinet door of access compartment No. 1 and turning on the lighting of access compartment No. 1.
[0121] To illustrate the above method of an embodiment of the present application, the first identifier and the second identifier in the third control information corresponding to the above first control event can be exemplarily represented. For example, the cabinet door of the target object access slot No. 1 can be identified as a1; the lighting of the target object access slot No. 1 can be identified as b1; and the target operation for the above target object, that is, the opening operation can be identified as 0.
[0122] Furthermore, according to the first data protocol, the identifier a1 of the cabinet door of the target object access slot No. 1 can be converted to A1; the identifier b1 of the lighting fixture of the target object access slot No. 1 can be converted to B1; the identifier 0 of the target operation for the above-mentioned target object, i.e., the opening operation, can be converted to open, etc., and then encapsulated as the fourth control information.
[0123] It should be noted that the above examples are only for illustrative purposes. In the process of encapsulating the first identifier and the second identifier to obtain the fourth control information, it is also necessary to convert the data address, data length, data packet number and other information of the first identifier and the second identifier according to the first data protocol. This application does not limit this.
[0124] In another embodiment of the present application, receiving first control information for a second device includes:
[0125] receiving first operation information corresponding to a first control event, where the first operation information includes a target object corresponding to the first control event and a target operation for the target object;
[0126] First control information is determined according to a target object corresponding to the first control event and a target operation for the target object.
[0127] Specifically, in an embodiment of the present application, the first device may be a server device that controls and schedules a smart access cabinet, and the second device may be a smart access cabinet that corresponds to a different data protocol from the first device. In an actual scenario, the server may receive a trigger operation for a first control event of the smart access cabinet. For example, a user may trigger the opening of access compartment No. 1 by a trigger operation such as scanning a code. The server receives the trigger operation and identifies that the first control event corresponding to the trigger operation is opening the cabinet door of access compartment No. 1 and turning on the light of access compartment No. 1. Among them, the target object corresponding to the first control event is the cabinet door and light of access compartment No. 1, and the target operation for the target object is an opening operation. Furthermore, the server may determine the first control information from the control information of the control events of multiple second devices based on the target object and target operation corresponding to the above-mentioned first control event.
[0128] Combination Figure 2, taking the first device as a server and the second device as a smart access cabinet as an example, the interaction between the first device and the second device in the embodiment of the present application is described:
[0129] In the embodiment of the present application, the server side adopts the first data protocol and the smart locker adopts the second data protocol. When the smart locker is connected to the server, step A can be executed first to upload the preset control information of the smart locker, that is, the control information of all control events of the smart locker. The preset control information is the control information that complies with the second data protocol.
[0130] After receiving the preset control information of the smart locker, the server parses the preset control information according to the protocol format of the second data protocol, determines the third control information corresponding to each control event, and then converts the third control information according to the protocol format of the first data protocol adopted by the server to obtain the fourth control information using the first data protocol. Furthermore, according to the correspondence between the third control information corresponding to each control event and the fourth control information, the data protocol conversion relationship is obtained, that is, step B.
[0131] During the actual use of the smart storage and access cabinet, the user can execute step C, i.e. trigger the first control event. Specifically, the first control event may include opening the access compartment of the smart storage and access cabinet, turning on the lighting, querying the status of the access compartment, querying the time of opening the access compartment, etc.
[0132] Furthermore, the smart cabinet may send a trigger operation of the first control event to the server, namely, step D.
[0133] When the server receives a trigger operation for a first control event of the smart locker, the server can determine the first control information corresponding to the first control event based on the trigger operation. For example, the server can determine the first control information from the above-mentioned multiple fourth control information based on the target object and target operation corresponding to the first event, and then convert the first control information into the second control information based on the data protocol conversion relationship, that is, step E.
[0134] Then, the second control information is sent to the smart locker, so that the smart locker executes the first control event, that is, step F.
[0135] The embodiment of the present application receives first control information from a second device, converts the first control information into second control information according to a preset data protocol conversion relationship, and then sends the second control information to the second device, thereby realizing control processing by the first device on the second device having a different data protocol with the first device.
[0136] The present application embodiment provides a possible implementation method, such as Figure 3As shown, a flowchart of an information processing method is provided, which can be executed by any electronic device. Optionally, the method is applied to a second device, which can be a terminal device, such as a smart locker, etc.
[0137] Specifically, Figure 3 As shown, the information processing method of the embodiment of the present application may include the following steps:
[0138] S301: Receive a triggering operation of a first control event, and determine first operation information, wherein the first operation information includes a target object corresponding to the first control event and a target operation for the target object.
[0139] Specifically, the second device includes a device having a different data protocol from the first device. For example, the data protocol of the first device is protocol a, and the data protocol of the second device is protocol b. In this case, when the first device and the second device have different data protocols, when the first device and the second device need to communicate, the information processing method provided in the embodiment of the present application can be used to implement information interaction or instruction interaction between the two devices.
[0140] The first device may be a device control server or other control tool or device. For ease of description, the method is applied to a device control server (hereinafter referred to as a server) as an example. The first device may communicate with multiple second devices.
[0141] For the sake of ease of description, the data protocol corresponding to the first device may be referred to as the first data protocol, the data protocol corresponding to the second device may be referred to as the second data protocol, and the control event for the second device may be referred to as the first control event, but this does not constitute a limitation on the embodiments of the present application.
[0142] Optionally, the first control event may include the following situations 1 to 4:
[0143] Case 1: The first control event may include a control event for controlling a device component of the second device. For example, a control event for controlling a device component of the second device to perform a corresponding action; taking the second device as a smart locker as an example, the device components may be a door, a lighting lamp, etc. of the smart locker. Accordingly, the first control event may include controlling to open a compartment door of the smart locker, turn on a lighting lamp, etc.
[0144] Case 2: The first control event may include a control event for querying the status of the second device. For example, querying the action status of a device component of the second device, querying the fault status of the second device, etc. Taking the second device as a smart access cabinet as an example, the first control event may include querying whether the door of the access compartment of the smart access cabinet is open, whether the lighting is turned on, etc.
[0145] Case 3: The first control event may include a control event for querying the control data of the second device, such as querying the fault data of the smart locker, querying the device identification of the smart locker, etc.
[0146] Case 4: the first control event may include a control event for testing the second device.
[0147] Optionally, in an embodiment of the present application, the second device may be a terminal device, which may include a variety of devices. For example, the terminal device may include a smart phone, a tablet computer, a laptop computer, a smart speaker, a smart watch, a smart locker, etc.; the following is an exemplary description taking the terminal device as a smart locker as an example.
[0148] As an example 1, the first device may be a server device that controls and schedules the smart access cabinet, and the second device may be a smart access cabinet corresponding to a different data protocol from the first device. In this example, the user may trigger the first control event of opening access slot 1 by scanning a code or other triggering operations. That is, in the first operation information, the target object corresponding to the first control event is access slot 1; and the target operation for the target object is an opening operation.
[0149] S302: Send the first operation information to a first device, wherein a data protocol conversion relationship exists between a first data protocol of the first device and a second data protocol of the second device.
[0150] The data protocol conversion relationship is a conversion relationship between a first data protocol of the first device and a second data protocol of the second device.
[0151] The data protocol conversion relationship may include a data address conversion relationship, a data format conversion relationship, a data content conversion relationship, a data length conversion relationship, etc. in the first control information and the second control information.
[0152] It is understandable that, according to the preset data protocol conversion relationship, the first control information can be converted into second control information that complies with the second data protocol of the second device, so that the first device can control the second device with a different data protocol.
[0153] The present application embodiment provides an information processing device, such as Figure 4 As shown, the information processing device 40 may include: a receiving module 401, a conversion module 402 and a sending module 403, wherein:
[0154] The receiving module 401 is configured to receive first control information for a second device;
[0155] A conversion module 402, configured to convert the first control information into second control information according to a preset data protocol conversion relationship; wherein the data protocol conversion relationship is a conversion relationship between a first data protocol of the first device and a second data protocol of the second device;
[0156] The sending module 403 is configured to send the second control information to the second device.
[0157] The embodiment of the present application receives first control information from a second device, converts the first control information into second control information according to a preset data protocol conversion relationship, and then sends the second control information to the second device, thereby realizing control processing by the first device on the second device having a different data protocol with the first device.
[0158] In one embodiment of the present application, the apparatus further includes a determination module, configured to determine the data protocol conversion relationship before receiving the first control information for the second device.
[0159] In one embodiment of the present application, the determination module is specifically configured to obtain third control information for the second device;
[0160] converting the third control information according to the first data protocol and the second data protocol to obtain fourth control information;
[0161] The data protocol conversion relationship is obtained according to the corresponding relationship between the third control information and the fourth control information.
[0162] In one embodiment of the present application, the determination module is specifically used to parse the third control information according to the second data protocol to obtain a first identifier and a second identifier in the third control information; the first identifier includes an identifier of a target object of the third control information, and the second identifier includes an identifier of a target operation for the target object;
[0163] According to the first data protocol, the first identifier and the second identifier are encapsulated to obtain fourth control information.
[0164] In one embodiment of the present application, the determination module is specifically configured to parse the preset control information of the second device according to the second data protocol to obtain the third control information;
[0165] and / or
[0166] The third control information is generated according to a preset control event of the second device and the second data protocol.
[0167] In one embodiment of the present application, the receiving module is specifically configured to:
[0168] A trigger operation of a first control event is received, and first control information is determined according to a target object corresponding to the first control event and a target operation for the target object.
[0169] In one embodiment of the present application, the first control event includes at least one of the following:
[0170] a component control event of the second device;
[0171] A status query event of the second device;
[0172] a control data query event of the second device;
[0173] A test event for the second device.
[0174] The information processing device of this embodiment can execute the information processing method shown in the above embodiments of the present application. The implementation principles are similar and will not be repeated here.
[0175] The embodiment of the present application receives first control information from a second device, converts the first control information into second control information according to a preset data protocol conversion relationship, and then sends the second control information to the second device, thereby realizing control processing by the first device on the second device having a different data protocol with the first device.
[0176] The present application embodiment provides an information processing device, such as Figure 5 As shown, the information processing device 50 may include: a determination module 501 and a sending module 502, wherein:
[0177] A determination module 501 is configured to receive a trigger operation of a first control event and determine first operation information, wherein the first operation information includes a target object corresponding to the first control event and a target operation for the target object;
[0178] The sending module 502 is used to send the first operation information to a first device, wherein a data protocol conversion relationship exists between a first data protocol of the first device and a second data protocol of the second device.
[0179] The information processing device of this embodiment can execute the information processing method shown in the above embodiments of the present application. The implementation principles are similar and will not be repeated here.
[0180] In the embodiment of the present application, according to the preset data protocol conversion relationship, the first control information can be converted into second control information that complies with the second data protocol of the second device, so that the first device can control the second device with a different data protocol.
[0181] An electronic device is provided in an embodiment of the present application, and the electronic device includes: a memory and a processor; at least one program, which is stored in the memory and is used to be executed by the processor. Compared with the prior art, the following can be achieved: the embodiment of the present application receives first control information of a second device, converts the first control information into second control information according to a preset data protocol conversion relationship, and then sends the second control information to the second device, thereby achieving control processing by the first device on the second device having a different data protocol with the second device.
[0182] In an alternative embodiment, an electronic device is provided, such as Figure 6 As shown, Figure 6 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0183] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0184] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0185] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.
[0186] The memory 4003 is used to store the application code (computer program) for executing the solution of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the contents shown in the above method embodiment.
[0187] The electronic devices include but are not limited to mobile phones, laptop computers, multimedia players, desktop computers, etc.
[0188] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding content in the aforementioned method embodiment.
[0189] The embodiment of the present application receives first control information from a second device, converts the first control information into second control information according to a preset data protocol conversion relationship, and then sends the second control information to the second device, thereby realizing control processing by the first device on the second device having a different data protocol with the first device.
[0190] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0191] The above descriptions are only some embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. An information processing method, applied to a first device, It is characterized in that include: receiving first control information for a second device; According to a preset data protocol conversion relationship, converting the first control information into second control information; wherein the data protocol conversion relationship is a conversion relationship between a first data protocol of the first device and a second data protocol of the second device; sending the second control information to the second device; Before receiving the first control information for the second device, the method further includes: receiving preset control information sent by the second device; Acquire third control information for the second device according to the preset control information; converting the third control information according to the first data protocol and the second data protocol to obtain fourth control information; The data protocol conversion relationship is obtained according to the corresponding relationship between the third control information and the fourth control information.
2. The information processing method according to claim 1, It is characterized in that The converting the third control information according to the first data protocol and the second data protocol to obtain fourth control information includes: Parsing the third control information according to the second data protocol to obtain a first identifier and a second identifier in the third control information; the first identifier includes an identifier of a target object of the third control information, and the second identifier includes an identifier of a target operation for the target object; According to the first data protocol, the first identifier and the second identifier are encapsulated to obtain fourth control information.
3. The information processing method according to claim 1, It is characterized in that The acquiring third control information for the second device includes: According to the second data protocol, the preset control information of the second device is parsed to obtain the third control information.
4. The information processing method according to claim 1, It is characterized in that Receiving first control information for a second device includes: receiving first operation information corresponding to a first control event, where the first operation information includes a target object corresponding to the first control event and a target operation for the target object; First control information is determined according to a target object corresponding to the first control event and a target operation for the target object.
5. The information processing method according to claim 4, It is characterized in that The first control event includes at least one of the following: a component control event of the second device; A status query event of the second device; a control data query event of the second device; A test event for the second device.
6. An information processing device, It is characterized in that include: A receiving module, configured to receive first control information for a second device; A conversion module, configured to convert the first control information into second control information according to a preset data protocol conversion relationship; wherein the data protocol conversion relationship is a conversion relationship between a first data protocol of the information processing device and a second data protocol of the second device; A sending module, configured to send the second control information to the second device; Before receiving the first control information for the second device, the method further includes: receiving preset control information sent by the second device; Acquire third control information for the second device according to the preset control information; converting the third control information according to the first data protocol and the second data protocol to obtain fourth control information; The data protocol conversion relationship is obtained according to the corresponding relationship between the third control information and the fourth control information.
7. An electronic device, It is characterized in that The electronic device comprises: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs are configured to: execute the information processing method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the information processing method according to any one of claims 1 to 5 is implemented.
