Session processing method and system based on coap, and storage medium
By establishing a CoAP protocol-based session processing method between the terminal device and the Internet of Things platform, and calculating the token value using encryption algorithm, the business interruption problem of terminal devices during IP changes is solved, efficient identity authentication and session reconstruction are achieved, and the improvement of the improvement of the The system maintainability and security is achieved.
Patent Information
- Application Number
- PCT/CN2024/122862
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-14
- Filing Date
- 2024-09-30
- Publication Date
- 2025-02-20
AI Technical Summary
In the scenario of massive terminal equipment access, existing CoAP protocol session processing methods are difficult to effectively manage the identity identification and session reconstruction of terminal equipment, resulting in service interruption and storage logic complexity.
Obtain your own identification information through the terminal device, establish a session with the Internet of Things platform, and use preset encryption algorithms to calculate the token value to realize identity authentication and session reconstruction between the terminal device and the Internet of Things platform.
It realizes service-free switching of terminal devices during IP changes, avoids the global maintenance and storage logic of large data volumes when accessing massive terminal devices, improves the maintainability and ease of application of session processing, and ensures the security of transmission. sex.
Smart Images

Figure CN2024122862_20022025_PF_FP_ABST
Abstract
Description
Session processing method, system and storage medium based on CoAP protocol Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to a session processing method, system and storage medium based on the CoAP protocol. Background Art
[0002] The CoAP protocol is an application layer protocol based on UDP. Its request-response mode is similar to HTTP. Because its underlying UDP transmission is more efficient, it is particularly suitable for communication between terminals and platforms in the field of the Internet of Things. In specific applications, the terminal acts as a CoAP server to maintain various resource attributes, and the platform acts as a CoAP client to subscribe to data on various resources from the terminal. The terminal reports resource data to the platform. The request-response model of the CoAP protocol provides a separation mode, that is, the platform initiates a get request to the terminal, the terminal replies with an empty ack, and then reports the business data to the platform after a period of time. If the terminal IP changes during the time interval, the data message reported by the terminal will penetrate the load layer and be distributed to different back-end business nodes. As a result, the back-end business node cannot recognize the terminal identity and the packet is lost, which leads to business interruption. To continue the business, the terminal needs to renegotiate with the platform to complete the login process. Currently, in order to achieve business continuity, a global token is maintained in the cloud. The terminal identity is found through the global token to achieve business continuity. However, the cloud needs to maintain the entire life cycle of the global token to ensure the global uniqueness of the token and the mapping relationship between the token and the terminal. When the amount of token data reaches dozens of times the number of devices, the storage volume is huge, and additional processing logic needs to be added to ensure global uniqueness. In the scenario of massive terminal devices being connected, query and write have high performance requirements, low maintainability and ease of application, and are difficult to implement.
[0003] Summary of the Invention
[0004] The embodiments of the present invention provide a session processing method, system, and storage medium based on the CoAP protocol, aiming to improve the maintainability and applicability of existing session processing.
[0005] In a first aspect, an embodiment of the present invention provides a session processing method based on the CoAP protocol, which includes:
[0006] The terminal device obtains its own identification information, wherein the identification information includes the device IP and the terminal identification;
[0007] The terminal device sends a login request carrying the identification information to the Internet of Things platform to establish a session with a first computing node corresponding to the device IP in the Internet of Things platform;
[0008] The first computing node in the Internet of Things platform calculates a token value according to the terminal identifier and a preset encryption algorithm, and sends the token value and the subscription information to be obtained to the terminal device;
[0009] The terminal device obtains the changed device IP as the changed device IP, obtains the reporting resource according to the subscription information, and sends the reporting resource, the token value, and the changed device IP to the IoT platform to log in to the second computing node corresponding to the changed device IP in the IoT platform;
[0010] The Internet of Things platform reconstructs a session with the terminal device according to the terminal identifier in the token value, the first computing node, and the second computing node, and processes the reported resources based on the reconstructed session.
[0011] In a second aspect, an embodiment of the present invention further provides a session processing system based on the CoAP protocol, which includes: an acquisition unit, a sending unit, and an acquisition and sending unit configured in a terminal device, a computing unit and a reconstruction processing unit configured in an Internet of Things platform, wherein:
[0012] The acquisition unit is used for the terminal device to obtain its own identification information, wherein the identification information includes the device IP and the terminal identification;
[0013] The sending unit is used for the terminal device to send a login request carrying the identification information to the Internet of Things platform to establish a session with the first computing node corresponding to the device IP in the Internet of Things platform;
[0014] The computing unit is used by the first computing node in the Internet of Things platform to calculate a token value according to the terminal identifier and a preset encryption algorithm, and send the token value and the subscription information to be obtained to the terminal device;
[0015] The acquiring and sending unit is configured to enable the terminal device to acquire the changed device IP as the changed device IP, acquire the reporting resource according to the subscription information, and send the reporting resource, the token value, and the changed device IP to the IoT platform to log in to the second computing node corresponding to the changed device IP in the IoT platform;
[0016] The reconstruction processing unit is used for the Internet of Things platform to reconstruct the session with the terminal device according to the terminal identifier in the token value, the first computing node and the second computing node, and to process the reported resources based on the reconstructed session.
[0017] In a third aspect, an embodiment of the present invention further provides a session processing system based on the CoAP protocol, which includes a terminal device and an Internet of Things platform, wherein the terminal device and the Internet of Things platform both include a memory and a processor, a computer program is stored on the memory, and the processors of the terminal device and the Internet of Things platform implement the above method when executing the computer program.
[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.
[0019] An embodiment of the present invention provides a session processing method, system, and storage medium based on the CoAP protocol. The method comprises: a terminal device obtains its own identification information, wherein the identification information includes a device IP and a terminal identifier; the terminal device sends a login request carrying the identification information to an Internet of Things platform to establish a session with a first computing node corresponding to the device IP in the Internet of Things platform; the first computing node in the Internet of Things platform calculates a token value based on the terminal identifier and a preset encryption algorithm, and sends the token value and subscription information to be obtained to the terminal device; the terminal device obtains a changed device IP as a changed device IP, obtains a reported resource based on the subscription information, and sends the reported resource, the token value, and the changed device IP to the Internet of Things platform to log in to a second computing node corresponding to the changed device IP in the Internet of Things platform; the Internet of Things platform reconstructs a session with the terminal device based on the terminal identifier in the token value, the first computing node, and the second computing node, and processes the reported resource based on the reconstructed session. According to the technical solution of the embodiment of the present invention, the terminal device first establishes a session with the first computing node corresponding to the device IP, and generates a token value at the first computing node according to the terminal identifier and a preset encryption algorithm; the terminal device obtains the changed device IP as the changed device IP, and sends the changed device IP, reported resources and token value to the second computing node corresponding to the changed device IP, and the second computing node decrypts the token value to obtain the terminal identifier to determine the terminal, thereby rebuilding the session to process the reported resources, realizing node switching and "zero" service loss, while avoiding the global maintenance and storage logic of large amounts of data when a large number of terminal devices are connected, improving the maintainability and applicability of session processing, and ensuring the security of transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] FIG1 is an overall architecture diagram of a session processing based on the CoAP protocol provided by an embodiment of the present invention;
[0022] FIG2 is a schematic diagram of a flow chart of a session processing method based on the CoAP protocol provided by an embodiment of the present invention;
[0023] FIG3 is a schematic diagram of an interaction process of a CoAP protocol-based session provided by an embodiment of the present invention;
[0024] FIG4 is a schematic block diagram of a session processing system based on the CoAP protocol provided by an embodiment of the present invention;
[0025] FIG5 is a schematic block diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0027] It will be understood that when used in this specification and the appended claims, the terms “comprises” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0028] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in the specification and appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0029] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0030] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0031] Please refer to Figure 1, which is an overall architecture diagram of session processing based on the CoAP protocol provided by an embodiment of the present invention. The overall architecture diagram includes a device layer, a load layer, and an access layer. The access layer is responsible for subscribing resources to terminal devices and processing data reported by terminal devices; the load layer is responsible for distributing terminal device reported data to different access nodes based on the terminal IP, and the device layer is responsible for resource subscription processing and data reporting. As shown in Figure 1, computing node A in the Internet of Things platform carries a token to subscribe to resource information from the terminal; after a period of time, the terminal device uses a separation mode to carry the token value and report resource information; due to the change of the device IP, the LB load component (load layer) will distribute the message to computing node B; computing node B obtains the terminal identifier based on the token decryption, requests computing node A to obtain the session information of the terminal device and rebuild the session, continues the business process, and notifies computing node A to destroy the session with the terminal device. By applying the token generated based on terminal identification and symmetric encryption algorithm to the CoAP protocol separation mode for data transmission, node switching and "zero" service loss are achieved. At the same time, the global maintenance and storage logic of large amounts of data when massive terminal devices are connected are avoided, the maintainability and applicability of session processing are improved, and the security of transmission is guaranteed.
[0032] Understandably, the terminal device can be a terminal device in smart cities, personal life, industry, agriculture, and smart homes, for example, smart parking, fire hydrants, water / gas meters, smart trash cans, street lights, smoke alarms, etc. in smart cities; wearable devices and item tracking, etc. in personal life; gas detection in industry; irrigation control, livestock management, etc. in agriculture; smart door locks, home appliance monitoring, etc. in smart homes. It should be noted that in this embodiment, the access layer includes multiple computing nodes, as shown in Figure 1, and also includes computing node C. In other embodiments, computing node D may also be included, depending on actual needs. It should also be noted that in this embodiment, the device layer is the layer where the terminal device is located, and the access layer and the load layer are the layers where the Internet of Things platform is located, that is, the Internet of Things platform includes a load layer and an access layer. The CoAP protocol includes a carrying mode and a detached mode, where the carrying mode is one request and one response; the detached mode is one request and two responses.
[0033] Figure 2 is a flow chart of a CoAP-based session processing method provided in an embodiment of the present invention. The CoAP-based session processing method of this embodiment of the present invention can be applied to CoAP-based session processing. For example, the CoAP-based session processing method can be implemented by a software program configured on a CoAP-based session processing program to improve the maintainability and applicability of session processing. As shown in Figure 2, the method includes the following steps S100-S140.
[0034] S100: The terminal device obtains its own identification information, wherein the identification information includes the device IP and the terminal identification.
[0035] In an embodiment of the present invention, the terminal device obtains its own identification information, wherein the identification information includes the device IP and the terminal identification; it should be noted that, in this embodiment, the identification information may also include information such as the terminal account, terminal password, and terminal service.
[0036] S110. The terminal device sends a login request carrying the identification information to the Internet of Things platform to establish a session with a first computing node corresponding to the device IP in the Internet of Things platform.
[0037] In an embodiment of the present invention, the terminal device sends a login request carrying the identification information to the load layer; the load layer sends the login request to the first computing node corresponding to the device IP in the Internet of Things platform based on the device IP, so that the first computing node establishes a session with the terminal device and obtains session information.
[0038] S120. The first computing node in the Internet of Things platform calculates a token value according to the terminal identifier and a preset encryption algorithm, and sends the token value and the subscription information to be obtained to the terminal device.
[0039] In an embodiment of the present invention, the first computing node in the Internet of Things platform calculates a token value based on the terminal identifier and the symmetric encryption algorithm, wherein the symmetric encryption algorithm is the AES symmetric encryption algorithm; the first computing node concatenates the preset subscription identifier with the resource information to be subscribed to form subscription information, and sends the subscription information and the token value to the terminal device, wherein the preset subscription identifier is "GET". Specifically, if the resource information to be subscribed to is temperature, "GET" and " / temperature" are concatenated to form the subscription information "GET / temperature". It should also be noted that the token value is a string, such as "1a2b3c4d", and the token value when sent is: token:1a2b3c4d.
[0040] S130. The terminal device obtains the changed device IP as the changed device IP, obtains the reporting resource according to the subscription information, and sends the reporting resource, the token value and the changed device IP to the Internet of Things platform to log in to the second computing node corresponding to the changed device IP in the Internet of Things platform.
[0041] In an embodiment of the present invention, the terminal device receives "token:1a2b3c4d" and "GET / temperature". At this time, if the device IP of the terminal device is changed due to network changes, that is, if the terminal device detects that the device IP has changed, the changed device IP is obtained as the changed device IP, and the subscription information is parsed to obtain the resource information, and the reported resources are obtained according to the resource information. For example, the reported resource is the reported temperature information of 22.5°; the reported resources, the token value and the changed device IP are sent to the load layer; the load layer sends the reported resources and the token value to the second computing node corresponding to the changed device IP according to the changed device IP, wherein the second computing node and the first computing node are both located in the access layer of the Internet of Things platform.
[0042] S140. The Internet of Things platform reconstructs a session with the terminal device according to the terminal identifier in the token value, the first computing node, and the second computing node, and processes the reported resources based on the reconstructed session.
[0043] In an embodiment of the present invention, the second computing node in the Internet of Things platform decrypts the token value through the AES symmetric encryption algorithm to obtain the terminal identifier; the second computing node rebuilds the session with the terminal device based on the terminal identifier and the first computing node. Specifically, the second computing node requests session information from the first computing node based on the terminal identifier; the second computing node receives the session information returned by the first computing node, and rebuilds the session with the terminal device based on the session information. It should be noted that after the second computing node receives the session information returned by the first computing node and rebuilds the session with the terminal device based on the session information, the second computing node will also send a destruction instruction to the first computing node, so that the first computing node destroys the session established with the terminal device according to the destruction instruction. Finally, the reported resources are processed based on the reconstructed session, thereby achieving business continuation and avoiding business interruption.
[0044] In this embodiment, to facilitate understanding of the conversation interaction process between the terminal device and the IoT platform, Figure 3 illustrates the interaction process of session processing based on the CoAP protocol. In Figure 3, the terminal device is referred to as the device, the first computing node is referred to as the platform computing node A, the second computing node is referred to as the platform computing node B, and the load layer is referred to as the LB. Data exchange between the IoT platform and the terminal device is achieved through the CoAP protocol. The LB load forwards uplink messages and selects a backend node to forward them based on the device IP address of the terminal device. When the device IP address changes, the IoT platform resolves the terminal identity based on the token and reestablishes the session, achieving seamless service continuity. The details are as follows: Device->LB: Device login request; LB->Platform Compute Node A: Complete login process; Platform Compute Node A->Platform Compute Node A: Calculate token:1a2b3c4d based on terminal ID and symmetric encryption algorithm; Device<-Platform Compute Node A: Subscribe to temperature resource GET / temperature token:1a2b3c4d; Device->Device: Device IP changes; Device->LB: Device reports temperature information "22.5" token:1a2b3c4d; LB->Platform Compute Node B: Distribute to Node B based on IP; Platform Compute Node B->Platform Compute Node B: Decrypt based on token to obtain terminal ID; Platform Compute Node B->Platform Compute Node A: Request session information based on terminal ID; Platform Compute Node A->Platform Compute Node B: Return session information; Platform Compute Node B->Platform Compute Node B: Reestablish session; Platform Compute Node B->Platform Compute Node A: Notify to destroy session.
[0045] This embodiment is applicable to the communication between the IoT platform and the terminal using the CoAP protocol separation mode. When the IP of the terminal device changes due to network reasons, the platform obtains the terminal identification through token decryption to determine the terminal identity, so as to achieve seamless service switching; at the same time, it avoids the global maintenance and storage logic of large amounts of token data. This application also uses the AES encryption algorithm for the token value generation process of the CoAP protocol to ensure the security of message transmission. This embodiment also draws on the concept of the Identity Cryptography System (IBC) and uses the identification directly for token generation. The communicating parties do not need to exchange public and private keys, do not need to store keys, and do not need third parties to provide authentication services. Both ease of use and security are better.
[0046] Figure 4 is a schematic block diagram of a CoAP-based session processing system 300 provided in accordance with an embodiment of the present invention. As shown in Figure 4 , corresponding to the CoAP-based session processing method applied to the terminal device and IoT platform, the CoAP-based session processing system 300 includes a unit for executing the CoAP-based session processing method. Specifically, referring to Figure 4 , the CoAP-based session processing system 300 includes an acquisition unit 101, a transmission unit 102, and an acquisition and transmission unit 103 configured in the terminal device, and a computing unit 201 and a reconstruction processing unit 202 configured in the IoT platform.
[0047] Among them, the acquisition unit 101 is used by the terminal device to obtain its own identification information, wherein the identification information includes the device IP and the terminal identification; the sending unit 102 is used by the terminal device to send a login request carrying the identification information to the Internet of Things platform to establish a session with the first computing node corresponding to the device IP in the Internet of Things platform; the calculation unit 201 is used by the first computing node in the Internet of Things platform to calculate a token value based on the terminal identification and a preset encryption algorithm, and send the token value and the subscription information to be obtained to the terminal device; the acquisition and sending unit 103 is used by the terminal device to obtain the changed device IP as the changed device IP, and obtain the reported resource based on the subscription information, and send the reported resource, the token value and the changed device IP to the Internet of Things platform to log in to the second computing node corresponding to the changed device IP in the Internet of Things platform; the reconstruction processing unit 202 is used by the Internet of Things platform to reconstruct the session between the terminal device and the terminal device based on the terminal identification in the token value, the first computing node and the second computing node, and process the reported resource based on the reconstructed session.
[0048] In some embodiments, such as this embodiment, the sending unit 102 includes a first sending subunit and a second sending subunit.
[0049] Among them, the first sending subunit is used by the terminal device to send the login request carrying the identification information to the load layer; the second sending subunit is used by the load layer to send the login request to the first computing node corresponding to the device IP in the Internet of Things platform according to the device IP, so that the first computing node establishes a session with the terminal device.
[0050] In some embodiments, such as this embodiment, the computing unit 201 includes a computing subunit and a splicing unit.
[0051] Among them, the computing subunit is used by the first computing node in the Internet of Things platform to calculate the token value according to the terminal identifier and the symmetric encryption algorithm; the splicing unit is used by the first computing node to splice the preset subscription identifier with the resource information to be subscribed to form subscription information, and send the subscription information and the token value to the terminal device.
[0052] In some embodiments, such as this embodiment, the acquisition and sending unit 103 includes an acquisition subunit, a third sending subunit, and a fourth sending subunit.
[0053] Among them, the acquisition subunit is used for the terminal device to obtain the changed device IP as the changed device IP if it detects that the device IP has changed, and to parse the subscription information to obtain the resource information, and obtain the reported resources based on the resource information; the third sending subunit is used to send the reported resources, the token value and the changed device IP to the load layer; the fourth sending subunit is used for the load layer to send the reported resources and the token value to the second computing node corresponding to the changed device IP based on the changed device IP, wherein the second computing node and the first computing node are both located in the access layer of the Internet of Things platform.
[0054] In some embodiments, such as this embodiment, the reconstruction processing unit 202 includes a decryption unit and a first reconstruction unit.
[0055] Among them, the decryption unit is used for the second computing node in the Internet of Things platform to decrypt the token value through the symmetric encryption algorithm to obtain the terminal identification; the first reconstruction unit is used for the second computing node to reconstruct the session between the second computing node and the terminal device based on the terminal identification and the first computing node.
[0056] In some embodiments, such as this embodiment, the first reconstruction unit includes a request unit and a second reconstruction unit.
[0057] Among them, the request unit is used for the second computing node to request session information from the first computing node according to the terminal identifier; the second reconstruction unit is used for the second computing node to receive the session information returned by the first computing node and to reconstruct the session between the second computing node and the terminal device according to the session information.
[0058] In some embodiments, such as this embodiment, the reconstruction processing unit 202 further includes a destruction unit.
[0059] The destroying unit is used for the second computing node to send a destroy instruction to the first computing node, so that the first computing node destroys the session established with the terminal device according to the destroy instruction.
[0060] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned CoAP protocol-based session processing system 300 and each unit can refer to the corresponding description in the aforementioned method embodiment. For the convenience and brevity of the description, it will not be repeated here.
[0061] The above-mentioned session processing system based on the CoAP protocol can be implemented in the form of a computer program, and the computer program can be run on the computer device shown in FIG5 .
[0062] Please refer to Figure 5, which is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 900 is a device that has established session processing based on the CoAP protocol.
[0063] 5 , the computer device 900 includes a processor 902 , a memory, and an interface 907 connected via a system bus 901 , wherein the memory may include a storage medium 903 and an internal memory 904 .
[0064] The storage medium 903 may store an operating system 9031 and a computer program 9032. When the computer program 9032 is executed, the processor 902 may execute a session processing method based on the CoAP protocol.
[0065] The processor 902 is used to provide computing and control capabilities to support the operation of the entire computer device 900.
[0066] The internal memory 904 provides an environment for the operation of the computer program 9032 in the storage medium 903. When the computer program 9032 is executed by the processor 902, the processor 902 can execute a session processing method based on the CoAP protocol.
[0067] The interface 905 is used to communicate with other devices. Those skilled in the art will understand that the structure shown in FIG5 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 900 to which the solution of the present application is applied. The specific computer device 900 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0068] The processor 902 of each of the terminal device and the IoT platform is configured to run a computer program 9032 stored in a memory to implement any embodiment of the above-mentioned session processing method based on the CoAP protocol.
[0069] It should be understood that in the embodiment of the present application, the processor 902 may be a central processing unit (CPU), and the processor 902 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0070] Those skilled in the art will appreciate that all or part of the steps in the method of the above-described embodiment can be implemented by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. The computer program is executed by at least one processor in the wireless communication system to implement the steps in the method of the above-described embodiment.
[0071] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to execute any embodiment of the above-mentioned session processing method based on the CoAP protocol.
[0072] The storage medium may be any computer-readable storage medium that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk.
[0073] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, wireless communication software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the composition and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0074] In the several embodiments provided herein, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the various units is merely a logical functional division, and actual implementations may employ other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented.
[0075] The steps in the method of the embodiment of the present invention may be adjusted in order, combined, or deleted as needed. The units in the system of the embodiment of the present invention may be combined, divided, or deleted as needed. In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit.
[0076] If this integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the existing technology, or all or part of the technical solution, can be embodied in the form of a software product. This wireless communication software product is stored in a storage medium and includes several instructions for causing a computer device (such as a personal wireless communication device, terminal, or network device) to execute all or part of the steps of the method described in various embodiments of the present invention.
[0077] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0078] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, to the extent such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
[0079] The foregoing description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art will readily conceive of various equivalent modifications or substitutions within the technical scope disclosed herein, and such modifications or substitutions are intended to be encompassed within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A session processing method based on the CoAP protocol, characterized in that: include: The terminal device obtains its own identification information, wherein the identification information includes the device IP and the terminal identification; The terminal device sends a login request carrying the identification information to the Internet of Things platform to establish a session with a first computing node corresponding to the device IP in the Internet of Things platform; The first computing node in the Internet of Things platform calculates a token value according to the terminal identifier and a preset encryption algorithm, and sends the token value and the subscription information to be obtained to the terminal device; The terminal device obtains the changed device IP as the changed device IP, obtains the reporting resource according to the subscription information, and sends the reporting resource, the token value and the changed device IP to the Internet of Things platform to log in to the second computing node corresponding to the changed device IP in the Internet of Things platform; The Internet of Things platform reconstructs a session with the terminal device according to the terminal identifier in the token value, the first computing node, and the second computing node, and processes the reported resources based on the reconstructed session.
2. The session processing method based on the CoAP protocol according to claim 1, characterized in that: The Internet of Things platform also includes a load layer, and the terminal device sends a login request carrying the identification information to the Internet of Things platform to establish a session with a first computing node corresponding to the device IP in the Internet of Things platform, including: The terminal device sends a login request carrying the identification information to the load layer; The load layer sends the login request to a first computing node corresponding to the device IP in the Internet of Things platform according to the device IP, so that the first computing node establishes a session with the terminal device.
3. The session processing method based on the CoAP protocol according to claim 2, characterized in that: The first computing node in the Internet of Things platform calculates a token value according to the terminal identifier and a preset encryption algorithm, and sends the token value and the subscription information to be obtained to the terminal device, including: The first computing node in the Internet of Things platform calculates a token value according to the terminal identifier and a symmetric encryption algorithm; The first computing node combines the preset subscription identifier with the resource information to be subscribed to form subscription information, and sends the subscription information and the token value to the terminal device.
4. The session processing method based on the CoAP protocol according to claim 3, characterized in that: The terminal device obtains the changed device IP as the changed device IP, obtains the reporting resource according to the subscription information, and sends the reporting resource, the token value, and the changed device IP to the Internet of Things platform to log in to the second computing node corresponding to the changed device IP in the Internet of Things platform, including: If the terminal device detects that the device IP has been changed, the terminal device obtains the changed device IP as the changed device IP, parses the subscription information to obtain the resource information, and obtains the reported resource according to the resource information; Sending the reported resource, the token value and the changed device IP to the load layer; The load layer sends the reported resources and the token value to a second computing node corresponding to the changed device IP according to the changed device IP, wherein the second computing node and the first computing node are both located at the access layer in the Internet of Things platform.
5. The session processing method based on the CoAP protocol according to claim 3, characterized in that: The Internet of Things platform reestablishes a session with the terminal device according to the terminal identifier in the token value, the first computing node, and the second computing node, including: The second computing node in the Internet of Things platform decrypts the token value by using the symmetric encryption algorithm to obtain the terminal identification; The second computing node reestablishes a session with the terminal device according to the terminal identifier and the first computing node.
6. The session processing method based on the CoAP protocol according to claim 5, characterized in that: The second computing node reestablishing a session with the terminal device according to the terminal identifier and the first computing node, including: The second computing node requests the first computing node for session information according to the terminal identifier; The second computing node receives the session information returned by the first computing node, and reestablishes the session with the terminal device according to the session information.
7. The session processing method based on the CoAP protocol according to claim 6, characterized in that: After the second computing node receives the session information returned by the first computing node and reestablishes the session with the terminal device according to the session information, the method further includes: The second computing node sends a destroy instruction to the first computing node, so that the first computing node destroys the session established with the terminal device according to the destroy instruction.
8. A session processing system based on the CoAP protocol, characterized in that: include: The acquisition unit, the sending unit and the acquisition and sending unit configured in the terminal device, the calculation unit and the reconstruction processing unit configured in the Internet of Things platform, wherein: The acquisition unit is used for the terminal device to acquire its own identification information, wherein the identification information includes the device IP and the terminal identification; The sending unit is used for the terminal device to send a login request carrying the identification information to the Internet of Things platform to establish a session with a first computing node corresponding to the device IP in the Internet of Things platform; The computing unit is used for the first computing node in the Internet of Things platform to calculate a token value according to the terminal identifier and a preset encryption algorithm, and send the token value and the subscription information to be obtained to the terminal device; The acquisition and sending unit is used for the terminal device to acquire the changed device IP as the changed device IP, and Subscribe to the information to obtain the reported resource, and send the reported resource, the token value and the changed device IP to the Internet of Things platform to log in to the second computing node corresponding to the changed device IP in the Internet of Things platform; The reconstruction processing unit is used for the Internet of Things platform to rebuild the session with the terminal device according to the terminal identifier in the token value, the first computing node and the second computing node, and process the reported resources based on the reconstructed session.
9. A session processing system based on the CoAP protocol, characterized in that: It includes a terminal device and an Internet of Things platform, and the terminal device and the Internet of Things platform both include a memory and a processor. A computer program is stored in the memory, and the processor of the terminal device and the Internet of Things platform implements the method described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 can be implemented.
Citation Information
Patent Citations
Encryption and decryption method and system based on software and hardware collaboration
CN113722726A
Multi-server switching response method and device without re-login, computer equipment and computer readable storage medium
CN116455659A
Cross-domain login method, server and readable storage medium
CN116582298A
Session processing method and system based on CoAP protocol, and storage medium
CN116915413A
Permission-based controlling network architectures and systems, having cellular network components and elements modified to host permission controlling schemas designed to facilitates electronic peer-to-peer communication sessions methods for use thereof
US11564266B1