Methods, devices, storage media and electronic devices for processing business information
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QINGDAO HAIER TECH
- Filing Date
- 2023-04-06
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, the processing efficiency of business information in smart home appliances is low, mainly because the business information carries target connection information of functional components that have no practical use, which reduces the processing efficiency.
By determining the connection channel identifier, connection information, command distribution identifier, and protocol type of the target component, the corresponding protocol configuration information is obtained, and the processing function is used to process the business information, thereby improving processing efficiency.
It improved the efficiency of business information processing and enhanced the user experience.
Smart Images

Figure CN116527738B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart home technology, and more specifically, to a method, apparatus, storage medium, and electronic device for processing business information. Background Technology
[0002] Currently, as the level of intelligence of smart home appliances continues to improve, people's demand for smart home appliances is also increasing, which in turn puts forward higher requirements for the processing efficiency of business information of smart home appliances.
[0003] In related fields, business information is typically processed collaboratively by multiple functional components within a cloud server. However, during the actual processing of business information, the processing efficiency of these components may decrease because the business information carries target connection information for certain functional components that is not of practical use to the business components. Therefore, related technologies present the technical challenge of improving the processing efficiency of business information.
[0004] No effective solution has yet been proposed for the technical problem of improving the efficiency of business information processing in related technologies. Summary of the Invention
[0005] This application provides a method, apparatus, storage medium, and electronic device for processing business information, in order to at least solve the technical problem of how to improve the processing efficiency of business information in related technologies.
[0006] According to one embodiment of this application, a method for processing business information is provided, comprising: responding to a control command of a target object; determining a target connection identifier of a connection channel where the target component indicated by the control command is located, wherein the connection channel is a channel created when the target component is registered; determining target connection information corresponding to the target connection identifier; determining a command distribution identifier corresponding to the control command and a protocol type used when the target component is registered from the connection information; determining protocol configuration information corresponding to the protocol type; obtaining a processing function that has a binding relationship with both the command distribution identifier and the protocol configuration information corresponding to the protocol type, wherein the binding relationship is bound when the target component is registered; and using the processing function to process the business information in the control command.
[0007] In an exemplary embodiment, determining the target connection identifier of the connection channel where the target component indicated by the control command is located includes: monitoring the channel port status of all connection channels, wherein different types of connection channels correspond to different types of channel ports; when a target channel port status indicating that the connection channel is in use is detected, determining the target connection channel corresponding to the target channel port status; if it is determined that the channel type of the target connection channel belongs to a preset channel type, and the channel type of the target connection channel is consistent with the channel type of the connection channel where the target component is located, determining the target connection identifier of the target connection channel as the target connection identifier of the connection channel where the target component is located.
[0008] In an exemplary embodiment, determining the target connection information corresponding to the target connection identifier includes: determining a connection management component for managing the connection channel, wherein the channel information includes at least the target connection identifier; obtaining the correspondence between the connection identifier of the connection channel and the connection information stored by the connection management component; and determining the target connection information corresponding to the target connection identifier based on the correspondence, wherein the target connection information includes at least one of the following: the connection status of the connection channel, the object identifier of the target object corresponding to the connection channel, the calling interface of the command distribution component, and the protocol information used when the target component is registered.
[0009] In an exemplary embodiment, determining the command distribution identifier corresponding to the control instruction from the connection information includes: calling the command distribution component's calling interface to implement the command distribution function to obtain the command distribution information corresponding to the target connection identifier, and obtaining the command distribution identifier from the command distribution information.
[0010] In an exemplary embodiment, determining the protocol type used when the target component is registered from the connection information includes: determining a parsing function for parsing the protocol type from the protocol information used when the target component is registered; and using the parsing function to parse the control command to obtain the protocol type used when the target component is registered contained in the control command.
[0011] In an exemplary embodiment, determining the protocol configuration information corresponding to the protocol type includes: obtaining a preset global protocol table, wherein the preset global protocol table includes all protocols used when different target components are registered; if it is determined that a first protocol corresponding to the protocol type belongs to the preset global protocol table, determining a second protocol consistent with the first protocol from the preset global protocol table, and determining the protocol configuration information corresponding to the second protocol as the protocol configuration information of the first protocol.
[0012] In an exemplary embodiment, after processing the business information in the control instruction using the processing function, the method further includes: generating response information based on the processing result; obtaining an encryption function for encrypting data from the protocol configuration information, and encrypting the response information using the encryption function to obtain encrypted response information; and sending the encrypted response information to the target object through the connection channel.
[0013] According to another aspect of the embodiments of this application, a business information processing apparatus is also provided, comprising: a response module, configured to respond to a control command of a target object and determine a target connection identifier of a connection channel where the target component indicated by the control command is located, wherein the connection channel is a channel created when the target component is registered; a determination module, configured to determine target connection information corresponding to the target connection identifier, and determine from the connection information a command distribution identifier corresponding to the control command and a protocol type used when the target component is registered; an acquisition module, configured to determine protocol configuration information corresponding to the protocol type, and acquire a processing function that has a binding relationship with both the command distribution identifier and the protocol configuration information corresponding to the protocol type, wherein the binding relationship is bound when the target component is registered; and a processing module, configured to process the business information in the control command using the processing function.
[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-mentioned business information processing method when running.
[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described business information processing method through the computer program.
[0016] In this embodiment, in response to a control command from a target object, the target connection identifier of the connection channel where the target component indicated by the control command resides is determined, wherein the connection channel is a channel created when the target component is registered; the target connection information corresponding to the target connection identifier is determined, and the command distribution identifier corresponding to the control command and the protocol type used when the target component is registered are determined from the connection information; the protocol configuration information corresponding to the protocol type is determined, and a processing function that has a binding relationship with both the command distribution identifier and the protocol configuration information corresponding to the protocol type is obtained, wherein the binding relationship is bound when the target component is registered; the processing function is used to process the business information in the control command. By adopting the above technical solution, the technical problem of how to improve the processing efficiency of business information is solved. Furthermore, based on the target connection identifier of the connection channel of the target component indicated by the control command, the protocol type is determined from the target connection information corresponding to the target connection identifier, and then the business information in the control command is processed according to the protocol configuration information corresponding to the protocol type, thereby improving the processing efficiency of business information and enhancing the user experience. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of the hardware environment for a business information processing method according to an embodiment of this application.
[0020] Figure 2 This is a flowchart of a business information processing method according to an embodiment of this application;
[0021] Figure 3 This is a system layer diagram of a business information processing method according to an embodiment of this application;
[0022] Figure 4 This is a system design diagram of a business information processing method according to an embodiment of this application;
[0023] Figure 5 This is a system logic diagram of a business information processing method according to an embodiment of this application;
[0024] Figure 6This is a connection and user mapping diagram of a business information processing method according to an embodiment of this application;
[0025] Figure 7 This is a schematic representation of a method for processing business information according to an embodiment of this application;
[0026] Figure 8 This is a global protocol static representation of the business information processing method according to the embodiments of this application;
[0027] Figure 9 This is an interactive diagram of a user terminal controlling a device according to a business information processing method according to an embodiment of this application.
[0028] Figure 10 This is a schematic diagram illustrating the process of binding a device to a user terminal according to the business information processing method of the embodiment of this application.
[0029] Figure 11 This is a structural block diagram of a business information processing apparatus according to an embodiment of this application. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0032] According to one aspect of the embodiments of this application, a method for processing business information is provided. This method is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-mentioned method for processing business information can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0033] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.
[0034] This embodiment provides a method for processing business information, applied to the aforementioned terminal device. Figure 2 This is a flowchart of a business information processing method according to an embodiment of this application, which includes the following steps:
[0035] Step S202: In response to the control command of the target object, determine the target connection identifier of the connection channel where the target component indicated by the control command is located, wherein the connection channel is the channel created when the target component is registered;
[0036] Step S204: Determine the target connection information corresponding to the target connection identifier, and determine the command distribution identifier corresponding to the control command and the protocol type used when the target component is registered from the connection information;
[0037] Step S206: Determine the protocol configuration information corresponding to the protocol type, and obtain a processing function that has a binding relationship with both the command distribution identifier and the protocol configuration information corresponding to the protocol type, wherein the binding relationship is bound when the target component is registered;
[0038] Step S208: Use the processing function to process the business information in the control command.
[0039] Through the above steps, in response to the control command of the target object, the target connection identifier of the connection channel where the target component indicated by the control command is located is determined, wherein the connection channel is the channel created when the target component is registered; the target connection information corresponding to the target connection identifier is determined, and the command distribution identifier corresponding to the control command and the protocol type used when the target component is registered are determined from the connection information; the protocol configuration information corresponding to the protocol type is determined, and a processing function that has a binding relationship with both the command distribution identifier and the protocol configuration information corresponding to the protocol type is obtained, wherein the binding relationship is bound when the target component is registered; the processing function is used to process the business information in the control command, thereby improving the processing efficiency of business information and thus enhancing the user experience.
[0040] In an exemplary embodiment, determining the target connection identifier of the connection channel where the target component indicated by the control command is located includes: monitoring the channel port status of all connection channels, wherein different types of connection channels correspond to different types of channel ports; when a target channel port status indicating that the connection channel is in use is detected, determining the target connection channel corresponding to the target channel port status; if it is determined that the channel type of the target connection channel belongs to a preset channel type, and the channel type of the target connection channel is consistent with the channel type of the connection channel where the target component is located, determining the target connection identifier of the target connection channel as the target connection identifier of the connection channel where the target component is located.
[0041] Optionally, the target channel port status can be monitored to determine the target connection channel in use, and then the target connection identifier of the connection channel where the target component is located can be assigned to the target connection channel that is consistent with the channel type of the connection channel where the target component is located.
[0042] In other words, a connection channel is created when the target component is registered. The connection channel has a preset channel type. Therefore, if the target component is using the connection channel to make a connection, the channel type of the connection channel that is detected as being in use will be consistent with the preset channel type. Thus, the target connection identifier of the connection channel that is being used will be determined as the target connection identifier of the connection channel created by the target component during registration.
[0043] In an exemplary embodiment, determining the target connection information corresponding to the target connection identifier includes: determining a connection management component for managing channel information of the connection channel, wherein the channel information includes at least the target connection identifier; obtaining the correspondence between the connection identifier of the connection channel and the connection information stored by the connection management component; and determining the target connection information corresponding to the target connection identifier based on the correspondence, wherein the target connection information includes at least one of the following: the connection status of the connection channel, the object identifier of the target object corresponding to the connection channel, the calling interface of the command distribution component, and the protocol information used when the target component is registered.
[0044] It should be noted that the target components include various components such as functional components, business components, and command distribution components that can establish connections with the connection table. Specifically, the connection management component stores a connection table to indicate the corresponding relationship. The connection table records key-value pairs corresponding to target connection identifiers and connection information. Therefore, the target connection information corresponding to the target connection identifier can be determined through the key-value pairs in the connection table, where the key corresponds to the target connection identifier and the value corresponds to the connection information. Figure 5 As shown, Figure 5 A diagram illustrating connection information, connection status, and a connection table is provided. In the table corresponding to connection information, `conn_id` can be understood as the target connection identifier. The connection statuses in the table include: initialization, connecting, connection failed, connected, ready, idle, and waiting to reconnect. Optionally, the protocol information used during registration corresponds to a protocol type, allowing the required protocol type to be determined from multiple protocol types based on this information.
[0045] In an exemplary embodiment, the process of determining the command distribution identifier corresponding to the control instruction from the connection information includes the following steps: calling the command distribution component's calling interface to implement the command distribution function to obtain the command distribution information corresponding to the target connection identifier, and obtaining the command distribution identifier from the command distribution information.
[0046] In an exemplary embodiment, the process of determining the protocol type used when registering the target component from the connection information is implemented through the following steps: determining a parsing function for parsing the protocol type from the protocol information used when registering the target component; using the parsing function to parse the control command to obtain the protocol type used when registering the target component contained in the control command.
[0047] Optionally, the protocol information may also include the command distribution component's calling interface, and then the protocol configuration information corresponding to the protocol type may be determined by calling the command calling interface through the calling interface.
[0048] In an exemplary embodiment, determining the protocol configuration information corresponding to the protocol type using the command distribution component includes: obtaining a preset global protocol table, wherein the preset global protocol table includes all protocols used when different target components register; if it is determined that a first protocol corresponding to the protocol type belongs to the preset global protocol table, determining a second protocol consistent with the first protocol from the preset global protocol table, and determining the protocol configuration information corresponding to the second protocol as the protocol configuration information of the first protocol.
[0049] Optional, global protocol table such as Figure 8 As shown, the nodes in the connection table point to the protocol nodes in the global protocol table. The global protocol table contains multiple protocols arranged horizontally in sequence. If a second protocol identical to the first protocol exists in the global protocol table, its protocol configuration information can be used as the protocol configuration information for the first protocol.
[0050] Optionally, a first protocol corresponding to the protocol type is determined, and the first protocol content of the first protocol is determined. A second protocol is determined based on the first protocol content, wherein the second protocol content is the same as the first protocol content. The configuration information corresponding to the second protocol can then be determined as the configuration information of the first protocol. Optionally, multiple protocols corresponding to the protocol type included in the global protocol table can be filtered out. A third protocol, identical to the first protocol, is determined from the multiple protocols based on the first protocol, and the protocol configuration information of the third protocol is determined as the configuration information of the first protocol.
[0051] Optionally, in an exemplary embodiment, the encryption protocol of the business information can be decrypted using the decryption function contained in the protocol configuration information to obtain the decrypted business information, wherein the protocol type of the encryption protocol is consistent with the protocol type used when the target component is registered; business processing instructions and business information to be processed are parsed from the decrypted business information; and the business information to be processed is processed using the processing function.
[0052] Optionally, if the encryption protocol type is the same as the registration protocol type, the encryption protocol of the business information can be correctly decrypted based on the decryption function included in the protocol configuration information determined by the protocol type, thereby obtaining the protected business information. The business information is then further parsed to perform the operations required by the business information, including processing the business information to be processed according to the processing function.
[0053] In an exemplary embodiment, after processing the business information in the control instruction using the processing function, the method further includes: generating response information based on the processing result; obtaining an encryption function for encrypting data from the protocol configuration information, and encrypting the response information using the encryption function to obtain encrypted response information; and sending the encrypted response information to the target object through the connection channel.
[0054] Optionally, in optional embodiments of this application, information is encrypted and decrypted using encryption and decryption functions, respectively. The encrypted information can exist in the form of a protocol or it can still exist in the form of information.
[0055] To better understand the process of the above-mentioned business information processing method, the implementation flow of the above-mentioned business information processing method will be described below in conjunction with optional embodiments, but it is not intended to limit the technical solution of the embodiments of this application.
[0056] This embodiment provides a method for processing business information. Figure 3 This is a system layer diagram of a business information processing method according to an embodiment of this application, such as... Figure 3 As shown, the connection-command distribution system is divided into components, mainly including connection components, connection management components, command distribution components, business components, protocol library security components, and system service components. If divided according to data flow, it includes several major parts: business, connection, connection management, command distribution, security (protocol library security), and system services.
[0057] The executable operations of each component of the connection-command distribution system, or the parts included in each component, include, but are not limited to, the following:
[0058] The command distribution component can perform operations including: forwarding data, forwarding tables, decryption, and unpacking.
[0059] The connection management component can perform operations including: storing connection tables, obtaining connection information, sending data, managing conn-ids, creating / deleting connections, and maintaining connection status.
[0060] The connectivity components can perform operations including: protocol framing: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol); long frame packetization: BLE (Bluetooth LE) and Serial (router port);
[0061] System services include: sys kernel (motherboard kernel), HAL (Hardware Abstraction Layer), AL, common components, IP stack, and RTE (Runtime Environment).
[0062] The service components include: softAP (wireless soft AP), device control, and OTA (Over-the-Air Technology).
[0063] The protocol library security components include: wifibase, USS (Universal Serial Interface Protocol), UWT, MQTT, CoAP, and TLS.
[0064] Furthermore, Figure 4 This is a system design diagram of a business information processing method according to an embodiment of this application;
[0065] The connection-command distribution system uses a registration method. Each functional component registers its own keywords in the command distribution table of the command distribution module. The command distribution component then distributes data to the corresponding functional component for processing based on the registered command keywords. The overall process is as follows:
[0066] Step S41: The connection management component creates a connection;
[0067] Step S42: The connection component calls the command distribution interface to drive the command distribution component;
[0068] Step S43: The command distribution component parses network data packets;
[0069] Step S44: Parse the command word and related data;
[0070] Step S45: Pass the callback of the business registration to the business module for processing.
[0071] Based on the above system design, the corresponding strategies of the connection-command distribution system for addressing business problems are as follows:
[0072] 1) For sending the same command word through different channels, the design uses a target connection identifier (conn_id) to uniformly identify the command word and its accompanying data, and returns it in ACK (Acknowledge character) to ensure the consistency and correctness of data processing and transmission.
[0073] 2) To address the issue that command dispatch threads may become a performance bottleneck, a multi-RTE task mode is adopted.
[0074] 3) Add a valid frame filter to the connection thread to filter out network frames that are not related to the command distribution thread.
[0075] 4) The command dispatch implementation considers protocol decoupling design to avoid protocol search using switch-case statements. It abstracts management interfaces and data structures for protocols, and registers processing function pointers for different protocols.
[0076] 5) Connection-related protocols are handled in the command dispatch thread, while business-related protocols are handled in the function thread.
[0077] 6) Establish a global target connection information database and maintain connection information and status (achieved through the connection management component).
[0078] Based on the corresponding strategies mentioned above Figure 5 This is a system logic diagram of a business information processing method according to an embodiment of this application, as shown in the attached diagram. Figure 5 As shown, the functions of each component are described below:
[0079] Connection component: Used for sending and receiving data.
[0080] The connection component includes an in queue for receiving service data from business components; querying connection information from the connection table of the connection management component; receiving creation, management, and deletion operations from the connection management module; and sending the cmdmgrmsg field code to the command distribution component.
[0081] Connection management component: Manages connections (creating, deleting, etc.);
[0082] The connection management component includes a connection information API and a connection table; the connection management component has connection information and can receive connection information queries from other components; the connection management component is also used to obtain protocol parsing from the protocol library.
[0083] Command dispatch component: Used to send connection data to the appropriate component.
[0084] The command distribution component has a command distribution table, as shown in the diagram below. Figure 5As shown in the command distribution table, the connection management component registers with the command distribution table, and the command distribution component also sends uni_cmd to the business component.
[0085] Business components: These are used to receive data from command distribution, process business logic, and send data to the connection; they are also used to create / update keys for security components; and to obtain protocol packages from the protocol library.
[0086] Security component: Primarily used for encrypting and decrypting data.
[0087] The above is a brief description of the various components in the connection-command distribution system. The following sections will introduce the connection component and the connection management component in detail:
[0088] 1) Connecting components:
[0089] a. Connection, as the name suggests, serves a connecting function. The main functions of the connection component are to send and receive data, and to establish TCP / IP protocol connections. This involves mapping connections to file descriptors (fds) on ports; different ports and connection types result in different connections; a single select statement can handle all connection ports and types.
[0090] b. The connection types of the connection components are based on different protocols, including:
[0091]
[0092]
[0093] c. The connectivity component is also equipped with Bluetooth: used to map connections to services, specifically as follows... Figure 6 As shown, this is used to map connections to users, where the connection port is 443, and users 1, 2, and 3 can be mapped to fd1, fd2, and fd3.
[0094] 2) Connection Management Component:
[0095] The main functions of the connection management component are as follows:
[0096] a. Management connectivity features, including:
[0097] Creating a connection requires a business logic trigger.
[0098] Deleting a connection requires a business logic trigger.
[0099] Maintaining the connection: heartbeat (different for each protocol);
[0100] Target connection identifier management (i.e., connection table management);
[0101] Connection parameter management (different for each protocol), such as connection address, TLS certificate, etc.;
[0102] Perform primary and secondary connection management.
[0103] b. Functions for handling fixed processes (connection business management - necessary interactions from connection establishment to business availability).
[0104] Access gateway address; USS authentication; version reporting; communication with connection components.
[0105] The connection management component also includes a connection table: a hash table used to store key-value pairs of target connection identifiers and connection information; the connection table corresponds to connection table nodes (i.e., connection nodes), and the connection node structure is defined as follows: Figure 7 As shown, each connection node stores all the information needed for a connection.
[0106] The connection management component also includes a global protocol static table (equivalent to the aforementioned preset global protocol table): the global protocol static table is a global array that stores the configurations of all protocols required by the system. When creating a connection, connection management retrieves the protocol configuration information from the static table based on the protocol type. Specifically, the relationship diagram between the global protocol static table, the connection table, and connection nodes is as follows: Figure 8 As shown.
[0107] Furthermore, based on the aforementioned connection-command distribution system, the following provides an example of how business information is processed.
[0108] in, Figure 9 This is an interactive diagram of a user terminal controlling a device according to the business information processing method of the embodiments of this application, such as... Figure 9 As shown, where:
[0109] The connection channel listens for and receives valid frames, then queries the connection table to obtain the command distribution method;
[0110] The command distribution component queries the connection table to obtain the proto, decrypts it, obtains the protocol parsing, queries the forwarding table, calls the callback function registered by the business, and sends the uni_cmd structure to the softap;
[0111] The softap retrieves the function from the cmd in the uni_cmd structure. The function processes the service date data, organizes the response data, and uses the conn_id in the uni_cmd structure to find the proto_encode. After interacting with the device management component and the backplane, the softap calls the common send method, calls unicmd_free to release memory, and sends uhos_connmgr_sendto_connect to the connection management component.
[0112] The connection management component retrieves the conn_id from the connection table to obtain the corresponding connection port fd, and then sends it to the connection component.
[0113] The connection component performs a send queue query operation to determine the file descriptor (fd) corresponding to the proto_type, and then sends the data.
[0114] Figure 10 This is a schematic diagram illustrating the process of binding a device to a user terminal according to the business information processing method of this application embodiment; as shown below. Figure 10 As shown, the specific process of binding the device to the user terminal can be referred to the above-described interaction process of the user terminal controlling the device, and will not be repeated in this embodiment.
[0115] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0116] Figure 11 This is a structural block diagram of a business information processing apparatus according to an embodiment of this application; as shown below. Figure 11 As shown, it includes:
[0117] The response module 112 is used to respond to the control command of the target object and determine the target connection identifier of the connection channel where the target component indicated by the control command is located, wherein the connection channel is a channel created when the target component is registered;
[0118] The determining module 114 is used to determine the target connection information corresponding to the target connection identifier, and to determine the command distribution identifier corresponding to the control instruction and the protocol type used when the target component is registered from the connection information;
[0119] The acquisition module 116 is used to determine the protocol configuration information corresponding to the protocol type and to acquire a processing function that has a binding relationship with both the command distribution identifier and the protocol configuration information corresponding to the protocol type, wherein the binding relationship is bound when the target component is registered;
[0120] The processing module 118 is used to process the business information in the control instruction using the processing function.
[0121] Using the aforementioned device, in response to control commands from the target object, the target connection identifier of the connection channel where the target component indicated by the control command is located is determined, wherein the connection channel is the channel created when the target component is registered; the target connection information corresponding to the target connection identifier is determined, and the command distribution identifier corresponding to the control command and the protocol type used when the target component is registered are determined from the connection information; the protocol configuration information corresponding to the protocol type is determined, and a processing function that has a binding relationship with both the command distribution identifier and the protocol configuration information corresponding to the protocol type is obtained, wherein the binding relationship is bound when the target component is registered; the processing function is used to process the business information in the control command, thereby improving the processing efficiency of business information and thus enhancing the user experience.
[0122] In an exemplary embodiment, the response module 112 is further configured to monitor the channel port status of all connection channels, wherein different types of connection channels correspond to different types of channel ports; when a target channel port status indicating that the connection channel is in use is detected, the target connection channel corresponding to the target channel port status is determined; if it is determined that the channel type of the target connection channel belongs to a preset channel type, and the channel type of the target connection channel is consistent with the channel type of the connection channel where the target component is located, the target connection identifier of the target connection channel is determined as the target connection identifier of the connection channel where the target component is located.
[0123] Optionally, the target channel port status can be monitored to determine the target connection channel in use, and then the target connection identifier of the connection channel where the target component is located can be assigned to the target connection channel that is consistent with the channel type of the connection channel where the target component is located.
[0124] In other words, a connection channel is created when the target component is registered. The connection channel has a preset channel type. Therefore, if the target component is using the connection channel to make a connection, the channel type of the connection channel that is detected as being in use will be consistent with the preset channel type. Thus, the target connection identifier of the connection channel that is being used will be determined as the target connection identifier of the connection channel created by the target component during registration.
[0125] In an exemplary embodiment, the determining module 114 is further configured to determine a connection management component for managing channel information of the connection channel, wherein the channel information includes at least the target connection identifier; obtain the correspondence between the connection identifier of the connection channel and the connection information stored by the connection management component; and determine the target connection information corresponding to the target connection identifier based on the correspondence, wherein the target connection information includes at least one of the following: the connection status of the connection channel, the object identifier of the target object corresponding to the connection channel, the calling interface of the command distribution component, and the protocol information used when the target component is registered.
[0126] It should be noted that the target components include various components such as functional components, business components, and command distribution components that can establish connections with the connection table. Specifically, the connection management component stores a connection table to indicate the corresponding relationship. The connection table records key-value pairs corresponding to target connection identifiers and connection information. Therefore, the target connection information corresponding to the target connection identifier can be determined through the key-value pairs in the connection table, where the key corresponds to the target connection identifier and the value corresponds to the connection information. Figure 5 As shown, Figure 5 The diagram illustrates connection information, connection status, and a connection table. In the table corresponding to connection information, `conn_id` serves as the target connection identifier. The connection statuses in this table include: initialization, connecting, connection failed, connected, ready, idle, and waiting to reconnect. Optionally, the protocol information used during registration corresponds to a specific protocol type, allowing the selection of the required protocol type from multiple options based on this information.
[0127] In an exemplary embodiment, the determining module 114 is further configured to invoke the command distribution function by calling the calling interface of the command distribution component to obtain the command distribution information corresponding to the target connection identifier, and to obtain the command distribution identifier from the command distribution information.
[0128] Optionally, the protocol information may also include the command distribution component's calling interface, and then the protocol configuration information corresponding to the protocol type may be determined by calling the command calling interface through the calling interface.
[0129] In an exemplary embodiment, the determining module 114 is further configured to determine a parsing function for parsing the protocol type from the protocol information used when the target component is registered; and use the parsing function to parse the control instruction to obtain the protocol type used when the target component is registered contained in the control instruction.
[0130] In an exemplary embodiment, the determining module 114 is further configured to obtain a preset global protocol table, wherein the preset global protocol table includes all protocols used when different target components are registered; if it is determined that the first protocol corresponding to the protocol type belongs to the preset global protocol table, a second protocol consistent with the first protocol is determined from the preset global protocol table, and the protocol configuration information corresponding to the second protocol is determined as the protocol configuration information of the first protocol.
[0131] Optional, global protocol table such as Figure 8 As shown, the nodes in the connection table point to the protocol nodes in the global protocol table. The global protocol table contains multiple protocols arranged horizontally in sequence. If a second protocol identical to the first protocol exists in the global protocol table, its protocol configuration information can be used as the protocol configuration information for the first protocol.
[0132] Optionally, a first protocol corresponding to the protocol type is determined, and the first protocol content of the first protocol is determined. A second protocol is determined based on the first protocol content, wherein the second protocol content is the same as the first protocol content. The configuration information corresponding to the second protocol can then be determined as the configuration information of the first protocol. Optionally, multiple protocols corresponding to the protocol type included in the global protocol table can be filtered out. A third protocol, identical to the first protocol, is determined from the multiple protocols based on the first protocol, and the protocol configuration information of the third protocol is determined as the configuration information of the first protocol.
[0133] In an exemplary embodiment, the processing module 118 is further configured to generate response information based on the processing result; obtain an encryption function for encrypting data from the protocol configuration information, and use the encryption function to encrypt the response information to obtain encrypted response information; and send the encrypted response information to the target object through the connection channel.
[0134] Optionally, if the encryption protocol type is the same as the registration protocol type, the encryption protocol of the business information can be correctly decrypted based on the decryption function contained in the protocol configuration information determined by the protocol type, thereby obtaining the protected business information. The business information is then further parsed to perform the operations required by the business information, including processing the pending business information according to the processing instructions within the business information.
[0135] Optionally, in optional embodiments of this application, information is encrypted and decrypted using encryption and decryption functions, respectively. The encrypted information can exist in the form of a protocol or it can still exist in the form of information.
[0136] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.
[0137] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:
[0138] S1, responding to the control command of the target object, determine the target connection identifier of the connection channel where the target component indicated by the control command is located, wherein the connection channel is the channel created when the target component is registered;
[0139] S2, determine the target connection information corresponding to the target connection identifier, and determine the command distribution identifier corresponding to the control instruction and the protocol type used when the target component is registered from the connection information;
[0140] S3, determine the protocol configuration information corresponding to the protocol type, and obtain a processing function that has a binding relationship with both the command distribution identifier and the protocol configuration information corresponding to the protocol type, wherein the binding relationship is bound when the target component is registered;
[0141] S4, use the processing function to process the business information in the control command.
[0142] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0143] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0144] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0145] S1, responding to the control command of the target object, determine the target connection identifier of the connection channel where the target component indicated by the control command is located, wherein the connection channel is the channel created when the target component is registered;
[0146] S2, determine the target connection information corresponding to the target connection identifier, and determine the command distribution identifier corresponding to the control instruction and the protocol type used when the target component is registered from the connection information;
[0147] S3, determine the protocol configuration information corresponding to the protocol type, and obtain a processing function that has a binding relationship with both the command distribution identifier and the protocol configuration information corresponding to the protocol type, wherein the binding relationship is bound when the target component is registered;
[0148] S4, use the processing function to process the business information in the control command.
[0149] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0150] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0151] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0152] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for processing business information, characterized in that, include: In response to the control command of the target object, determine the target connection identifier of the connection channel where the target component indicated by the control command is located, wherein the connection channel is a channel created when the target component is registered, and the target component includes one of the following: a functional component, a business component, and a command distribution component; The target connection information corresponding to the target connection identifier is determined, and the command distribution identifier corresponding to the control instruction and the protocol type used when the target component is registered are determined from the connection information. Determine the protocol configuration information corresponding to the protocol type, and obtain a processing function that has a binding relationship with both the command distribution identifier and the protocol configuration information corresponding to the protocol type, wherein the binding relationship is bound when the target component is registered; The processing function is used to process the business information in the control command; Determining the target connection identifier of the connection channel where the target component indicated by the control command is located includes: Monitor the channel port status of all connection channels, where different types of connection channels correspond to different types of channel ports; If a target channel port state indicating that the connection channel is in use is detected, the target connection channel corresponding to the target channel port state is determined. If it is determined that the channel type of the target connection channel belongs to a preset channel type, and the channel type of the target connection channel is consistent with the channel type of the connection channel where the target component is located, then the target connection identifier of the target connection channel is determined as the target connection identifier of the connection channel where the target component is located.
2. The method for processing business information according to claim 1, characterized in that, Determining the target connection information corresponding to the target connection identifier includes: A connection management component is identified for managing channel information of the connection channel, wherein the channel information includes at least the target connection identifier; Obtain the correspondence between the connection identifier and the connection information of the connection channel stored in the connection management component; The target connection information corresponding to the target connection identifier is determined based on the correspondence, wherein the target connection information includes at least one of the following: The connection status of the connection channel, the object identifier of the target object corresponding to the connection channel, the calling interface of the command distribution component, and the protocol information used when the target component is registered.
3. The method for processing business information according to claim 2, characterized in that, Determining the command distribution identifier corresponding to the control command from the connection information includes: The command distribution function is invoked by calling the calling interface of the command distribution component to obtain the command distribution information corresponding to the target connection identifier, and the command distribution identifier is obtained from the command distribution information.
4. The method for processing business information according to claim 2, characterized in that, Determining the protocol type used by the target component during registration from the connection information includes: The parsing function for parsing the protocol type is determined from the protocol information used when the target component is registered; The control command is parsed using the parsing function to obtain the protocol type used by the target component during registration, which is contained in the control command.
5. The method for processing business information according to claim 1, characterized in that, The protocol configuration information corresponding to the protocol type is determined, including: Obtain a preset global protocol table, wherein the preset global protocol table includes all protocols used when different target components register; If it is determined that the first protocol corresponding to the protocol type belongs to the preset global protocol table, a second protocol consistent with the first protocol is determined from the preset global protocol table, and the protocol configuration information corresponding to the second protocol is determined as the protocol configuration information of the first protocol.
6. The method for processing business information according to claim 1, characterized in that, After processing the business information in the control instruction using the processing function, the method further includes: Response information is generated based on the processing results described above; Obtain the encryption function for encrypting data from the protocol configuration information, and use the encryption function to encrypt the response information to obtain the encrypted response information; The encrypted response information is sent to the target object through the connection channel.
7. A business information processing device, characterized in that, include: The response module is used to respond to the control commands of the target object and determine the target connection identifier of the connection channel where the target component indicated by the control command is located. The connection channel is a channel created when the target component is registered. The target component includes one of the following: a functional component, a business component, and a command distribution component. The determination module is used to determine the target connection information corresponding to the target connection identifier, and determine the command distribution identifier corresponding to the control instruction and the protocol type used when the target component is registered from the connection information; The acquisition module is used to determine the protocol configuration information corresponding to the protocol type and to acquire a processing function that has a binding relationship with both the command distribution identifier and the protocol configuration information corresponding to the protocol type, wherein the binding relationship is bound when the target component is registered; The processing module is used to process the business information in the control instructions using the processing function; The response module is also used to monitor the channel port status of all connection channels, wherein different types of connection channels correspond to different types of channel ports; when a target channel port status indicating that the connection channel is in use is detected, the target connection channel corresponding to the target channel port status is determined; if it is determined that the channel type of the target connection channel belongs to a preset channel type, and the channel type of the target connection channel is consistent with the channel type of the connection channel where the target component is located, the target connection identifier of the target connection channel is determined as the target connection identifier of the connection channel where the target component is located.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 6.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 6 through the computer program.