Session Processing Method, System and Storage Medium Based on CoAP Protocol

By establishing a secure session based on CoAP protocol between the terminal device and the Internet of Things platform and rebuilding the session with token value, the business interruption and global token maintenance problems during access to massive terminal devices is solved, and the system maintainability and ease of application are improved.

CN116915413BActive Publication Date: 2025-05-27E SURFING IOT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311021205.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-14
Publication Date
2025-05-27
Estimated Expiration
2043-08-14

AI Technical Summary

Technical Problem

In the scenario of massive terminal equipment access, existing CoAP protocol session processing methods are difficult to ensure maintainability and ease of application, especially when terminal IP changes, resulting in service interruption and high storage and maintenance requirements of global tokens.

Method used

The terminal device obtains its own identification information, establishes a conversation with the Internet of Things platform, and uses preset encryption algorithms to calculate the token value to achieve secure communication between the terminal device and the Internet of Things platform. When the IP of the terminal device is changed, the session is rebuilt with the token value to avoid service interruption.

Benefits of technology

It realizes service-free switching when the IP of the terminal device is changed, reduces the storage and maintenance needs of global tokens, improves the maintainability and ease of application of session processing, and ensures the security of transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116915413B_ABST
    Figure CN116915413B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a session processing method, system, and storage medium based on the CoAP protocol. This method belongs to the field of Internet of Things technology. In the embodiment of the present application, the terminal device first establishes a session with the first computing node corresponding to the device IP, and the first computing node generates a token value 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, the reported resource, and the token value to the second computing node corresponding to the changed device IP. The second computing node decrypts the token value to obtain the terminal identifier to determine the terminal, thereby reconstructing the session to process the reported resource, realizing node switching, zero loss of services, and at the same time avoiding the global maintenance and storage logic of a large amount of data when a large number of terminal devices are accessed, improving the maintainability and applicability of session processing, and ensuring the security of transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of the 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 working mode is similar to HTTP. Since its underlying layer uses UDP, the transmission efficiency is higher, and it is particularly suitable for realizing 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 of 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 sends a get request to the terminal, and the terminal replies with an empty ack, and then reports the service data to the platform after a period of time. If the terminal IP changes during the time interval, the data packet reported by the terminal passing through the load layer will be distributed to different back-end service nodes, resulting in the back-end service nodes being unable to identify the terminal identity and being dropped, which in turn causes service interruption. For the terminal to resume the service, it needs to re-negotiate with the platform to complete the login process. At present, in order to realize service continuation, a global token is maintained in the cloud. By looking up the terminal identity through the global token, service continuation is realized. However, the cloud needs to maintain the entire life cycle of the global token, ensure the global uniqueness of the token, and the mapping relationship between the token and the terminal. When the data volume of the token 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 accessing a large number of terminal devices, the query and writing have high performance requirements, and the maintainability and ease of application are low, and the implementation difficulty is large. Summary of the Invention

[0003] 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 ease of application of existing session processing.

[0004] In a first aspect, embodiments of the present invention provide a session processing method based on the CoAP protocol, which includes:

[0005] The terminal device obtains its own identification information, where the identification information includes the device IP and the terminal identifier;

[0006] 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;

[0007] 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;

[0008] The terminal device obtains the changed device IP as the changed device IP, obtains the reported resources according to the subscription information, and sends the reported resources, 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;

[0009] The Internet of Things platform reconstructs a session with the terminal device according to the terminal identifier, the first computing node, and the second computing node in the token value, and processes the reported resources based on the reconstructed session.

[0010] 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, and a computing unit and a reconstruction processing unit configured in the Internet of Things platform. Among them,

[0011] The acquisition unit is used for the terminal device to obtain its own identification information, where the identification information includes the device IP and the terminal identifier;

[0012] 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;

[0013] 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;

[0014] The acquisition and sending unit is used for the terminal device to obtain the changed device IP as the changed device IP, obtain the reported resources according to the subscription information, and send the reported resources, 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;

[0015] The reconstruction processing unit is used for the Internet of Things platform to reconstruct a session with the terminal device according to the terminal identifier, the first computing node, and the second computing node in the token value, and process the reported resources based on the reconstructed session.

[0016] 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. Both the terminal device and the Internet of Things platform include a memory and a processor. A computer program is stored on the memory. When the processors of the terminal device and the Internet of Things platform execute the computer program, the above method is implemented.

[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the above method can be implemented.

[0018] An embodiment of the present invention provides a session processing method, system and storage medium based on the CoAP protocol. Among them, the method includes: the terminal device obtains its own identification information, where the identification information includes the device IP and the terminal identifier; the terminal device sends 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 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 reported resources according to the subscription information, and sends the reported resources, 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 the session with the terminal device according to the terminal identifier, the first computing node and the second computing node in the token value, and processes the reported resources based on the reconstructed session. The technical solution of the embodiment of the present invention is that the terminal device first establishes a session with the first computing node corresponding to the device IP, and the first computing node generates a token value 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, the reported resources and the token value to the second computing node corresponding to the changed device IP. The second computing node decrypts the token value to obtain the terminal identifier to determine the terminal, thereby reconstructing the session to process the reported resources, realizing node switching, "zero" loss of services, and at the same time avoiding the global maintenance and storage logic of a large amount of data when a large number of terminal devices are accessed, improving the maintainability and applicability of session processing, and ensuring the security of transmission. Description of the Drawings

[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0020] Figure 1 It is an overall architecture diagram of session processing based on the CoAP protocol provided by an embodiment of the present invention;

[0021] Figure 2 It is a schematic flowchart of a session processing method based on the CoAP protocol provided by an embodiment of the present invention;

[0022] Figure 3 It is an interaction schematic diagram of session processing based on the CoAP protocol provided by an embodiment of the present invention;

[0023] Figure 4 It is a schematic block diagram of a session processing system based on the CoAP protocol provided by an embodiment of the present invention;

[0024] Figure 5 It is a schematic block diagram of a computer device provided by an embodiment of the present invention. Detailed implementation manners

[0025] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the protection scope of the present invention.

[0026] It should be understood that when used in this specification and the appended claims, the terms "comprises" and "comprising" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0027] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.

[0028] It should also be further understood that the term "and / or" as used in the specification and appended claims of the present invention refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0029] As used in this specification and the appended claims, the term "if" may be construed, depending on the context, as "when", "once", "in response to determining", or "in response to detecting". Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be construed, depending on the context, as meaning "once determined", "in response to determining", "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]".

[0030] Please refer to Figure 1 , Figure 1 is the overall architecture diagram of session processing based on the CoAP protocol provided by an embodiment of the present invention. This overall architecture diagram includes a device layer, a load layer, and an access layer. The access layer is responsible for subscribing to resources from terminal devices and processing data reported by terminal devices; the load layer is responsible for distributing the data reported by terminal devices to different access nodes according to the terminal IP, and the device layer is responsible for processing resource subscriptions and data reporting. As Figure 1 shown, in the Internet of Things platform, computing node A carries a token to subscribe to resource information from the terminal; after a period of time, the terminal device carries the token value in the separation mode and reports the resource information; since the device IP has changed, the LB load component (load layer) will distribute the message to computing node B; computing node B decrypts the token to obtain the terminal identifier, requests the session information of the terminal device from computing node A and reconstructs 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 the terminal identifier and the symmetric encryption algorithm to the data transmission in the CoAP protocol separation mode, node switching is achieved, and the business has "zero" loss. At the same time, when a large number of terminal devices are accessed, the global maintenance and storage logic of a large amount of data is avoided, the maintainability and ease of application of session processing are improved, and the security of transmission is ensured.

[0031] Understandably, the terminal device can be a terminal device in smart cities, personal life, industry, agriculture, and smart homes. For example, intelligent parking, fire hydrants, water / gas meters, smart trash cans, street lights, smoke alarms, etc. in smart cities; wearable devices, 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, such as Figure 1As shown, it further includes a computing node C. In other embodiments, it may further include a computing node D, depending on actual requirements. 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 IoT platform is located, that is, the IoT platform includes the load layer and the access layer. The CoAP protocol includes a carry mode and a separation mode. Among them, the carry mode is one request and one response; the separation mode is one request and two responses.

[0032] Figure 2 It is a schematic flowchart of a session processing method based on the CoAP protocol provided by an embodiment of the present invention. The session processing method based on the CoAP protocol in the embodiment of the present invention can be applied to session processing based on the CoAP protocol. For example, the session processing method based on the CoAP protocol can be implemented through a software program configured on the session processing based on the CoAP protocol to improve the maintainability and applicability of session processing. As Figure 2 shown, the method includes the following steps S100 - S140.

[0033] S100. The terminal device obtains its own identification information, where the identification information includes the device IP and the terminal identifier.

[0034] In the embodiment of the present invention, the terminal device obtains its own identification information, where the identification information includes the device IP and the terminal identifier. It should be noted that, in this embodiment, the identification information may further include information such as the terminal account, the terminal password, and the terminal service.

[0035] S110. The terminal device sends a login request carrying the identification information to the IoT platform to establish a session with a first computing node corresponding to the device IP in the IoT platform.

[0036] In the 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 a first computing node corresponding to the device IP in the IoT platform according to the device IP, so that the first computing node can establish a session with the terminal device to obtain session information.

[0037] S120. The first computing node in the IoT 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.

[0038] In an embodiment of the present invention, the first computing node in the Internet of Things platform calculates a token value according to the terminal identifier and a symmetric encryption algorithm, where the symmetric encryption algorithm is the AES symmetric encryption algorithm; the first computing node splices a preset subscription identifier and resource information to be subscribed to form subscription information, and sends the subscription information and the token value to the terminal device, where the preset subscription identifier is "GET". Specifically, if the resource information to be subscribed to is temperature, then "GET" and " / temperature" are spliced to form the subscription information "GET / temperature". It should also be noted that the token value is a string, such as "1a2b3c4d", and when sent, the token value is: token: 1a2b3c4d.

[0039] S130. The terminal device obtains the changed device IP as the changed device IP, obtains the reported resources according to the subscription information, and sends the reported resources, 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.

[0040] 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 changes due to network changes, that is, if the terminal device detects that the device IP has changed, it obtains the changed device IP as the changed device IP, parses the subscription information to obtain the resource information, obtains the reported resources 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, where the second computing node and the first computing node are both located in the access layer of the Internet of Things platform.

[0041] S140. The Internet of Things platform reconstructs a session with the terminal device according to the terminal identifier, the first computing node, and the second computing node in the token value, and processes the reported resources based on the reconstructed session.

[0042] 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 reconstructs a session with the terminal device according to the terminal identifier and the first computing node. Specifically, the second computing node requests session information from the first computing node according to the terminal identifier; the second computing node receives the session information returned by the first computing node, and reconstructs a session with the terminal device according to the session information. It should be noted that after the second computing node receives the session information returned by the first computing node and reconstructs a session with the terminal device according to 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, so as to realize the continuation of the service and avoid the interruption of the service.

[0043] In this embodiment, for the convenience of understanding the interaction process of the session between the terminal device and the Internet of Things platform, as Figure 3 shown, the interaction process of session processing based on the CoAP protocol is shown. In Figure 3 , the terminal device is called a device, the first computing node is called the platform computing node A, the second computing node is called the platform computing node B, and the load layer is called LB. The Internet of Things platform and the terminal device realize data interaction through the CoAP protocol. The LB load forwards the upstream message and selects the backend node to forward according to the device IP of the terminal device. When the device IP changes, the Internet of Things platform resolves the terminal identity according to the token and reconstructs the session to realize the seamless continuation of the service. Specifically as follows: Device -> LB: Device login request; LB -> Platform computing node A: Complete the login process; Platform computing node A -> Platform computing node A: Calculate according to the terminal identifier and the symmetric encryption algorithm, token: 1a2b3c4d; Device <- Platform computing node A: Subscribe to temperature resources GET / temperature token: 1a2b3c4d; Device -> Device: The device IP changes; Device -> LB: The device reports temperature information "22.5" token: 1a2b3c4d; LB -> Platform computing node B: Distribute to node B according to the IP; Platform computing node B -> Platform computing node B: Decrypt according to the token to obtain the terminal identifier; Platform computing node B -> Platform computing node A: Request session information according to the terminal identifier; Platform computing node A -> Platform computing node B: Return session information; Platform computing node B -> Platform computing node B: Reconstruct the session; Platform computing node B -> Platform computing node A: Notify to destroy the session.

[0044] This embodiment is applicable to the communication between the IoT platform and the terminal in the CoAP protocol separation mode. When the IP of the terminal device changes due to network reasons, the platform decrypts the token to obtain the terminal identifier to determine the terminal identity, achieving seamless business switching; at the same time, it avoids the global maintenance and storage logic of the large amount of token data. This application also uses the AES encryption algorithm in the generation process of the token value of the CoAP protocol to ensure the security of message transmission. This embodiment also draws on the concept of the identity-based cryptosystem (IBC), directly using the identity in the generation of the token. The communication parties do not need to exchange public and private keys, do not need to save keys, and do not need a third party to provide authentication services, with better usability and security.

[0045] Figure 4 FIG. 4 is a schematic block diagram of a session processing system 300 based on the CoAP protocol provided by an embodiment of the present invention. As Figure 4 shown, corresponding to the above-mentioned session processing method based on the CoAP protocol applied to the terminal device and the IoT platform, the session processing system 300 based on the CoAP protocol includes units for executing the above-mentioned session processing method based on the CoAP protocol. Specifically, please refer to Figure 4 FIG. 4. The session processing system 300 based on the CoAP protocol includes an acquisition unit 101, a sending unit 102, and an acquisition and sending unit 103 configured in the terminal device, and a calculation unit 201 and a reconstruction processing unit 202 configured in the IoT platform.

[0046] Among them, the acquisition unit 101 is used for the terminal device to acquire its own identification information, where the identification information includes the device IP and the terminal identifier; the sending unit 102 is used for the terminal device to send a login request carrying the identification information to the IoT platform to establish a session with a first calculation node corresponding to the device IP in the IoT platform; the calculation unit 201 is used for the first calculation node in the IoT 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 acquired to the terminal device; the acquisition and sending unit 103 is used for the terminal device to acquire the changed device IP as the changed device IP, acquire the reported resources according to the subscription information, and send the reported resources, the token value, and the changed device IP to the IoT platform to log in to a second calculation node corresponding to the changed device IP in the IoT platform; the reconstruction processing unit 202 is used for the IoT platform to reconstruct the session with the terminal device according to the terminal identifier, the first calculation node, and the second calculation node in the token value, and process the reported resources based on the reconstructed session.

[0047] In some embodiments, such as this embodiment, the sending unit 102 includes a first sending subunit and a second sending subunit.

[0048] Among them, the first sending subunit is used for the terminal device to send a login request carrying the identification information to the load layer; the second sending subunit is used for the load layer to send 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.

[0049] In some embodiments, such as this embodiment, the computing unit 201 includes a computing subunit and a splicing unit.

[0050] Among them, the computing subunit 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 symmetric encryption algorithm; the splicing unit is used for the first computing node to splice a preset subscription identifier and resource information to be subscribed to form subscription information, and send the subscription information and the token value to the terminal device.

[0051] In some embodiments, such as this embodiment, the obtaining and sending unit 103 includes an obtaining subunit, a third sending subunit, and a fourth sending subunit.

[0052] Among them, the obtaining 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, parse the subscription information to obtain the resource information, and obtain the reported resource according to the resource information; the third sending subunit is used to send the reported resource, 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 resource and the token value to a second computing node corresponding to the changed device IP according to the changed device IP, where both the second computing node and the first computing node are located in the access layer of the Internet of Things platform.

[0053] In some embodiments, such as this embodiment, the reconstruction processing unit 202 includes a decryption unit and a first reconstruction unit.

[0054] 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 identifier; the first reconstruction unit is used for the second computing node to reconstruct a session with the terminal device according to the terminal identifier and the first computing node.

[0055] In some embodiments, such as this embodiment, the first reconstruction unit includes a request unit and a second reconstruction unit.

[0056] Wherein, 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 reconstruct the session with the terminal device according to the session information.

[0057] In some embodiments, such as this embodiment, the reconstruction processing unit 202 further includes a destruction unit.

[0058] Wherein, the destruction unit is used for the second computing node to 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.

[0059] It should be noted that those skilled in the art can clearly understand that the specific implementation processes of the above session processing system 300 based on the CoAP protocol and each unit can refer to the corresponding descriptions in the foregoing method embodiments. For the sake of convenience and brevity of description, they will not be elaborated here.

[0060] The above session processing system based on the CoAP protocol can be implemented in the form of a computer program, and this computer program can run on a computer device as shown in Figure 5 shown.

[0061] Please refer to Figure 5 , Figure 5 which is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 900 is a device configured with session processing based on the CoAP protocol.

[0062] Referring to Figure 5 , the computer device 900 includes a processor 902, a memory, and an interface 907 connected through a system bus 901. Among them, the memory may include a storage medium 903 and an internal memory 904.

[0063] The storage medium 903 can store an operating system 9031 and a computer program 9032. When the computer program 9032 is executed, the processor 902 can be made to execute a session processing method based on the CoAP protocol.

[0064] The processor 902 is used to provide computing and control capabilities to support the operation of the entire computer device 900.

[0065] 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 be caused to execute a session processing method based on the CoAP protocol.

[0066] The interface 905 is used to communicate with other devices. Those skilled in the art can understand that Figure 5 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device 900 to which the solution of this application is applied. The specific computer device 900 may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.

[0067] Among them, the respective processors 902 of the terminal device and the Internet of Things platform are used to run the computer program 9032 stored in the memory to implement any embodiment of the above-mentioned session processing method based on the CoAP protocol.

[0068] It should be understood that in the embodiments of this 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 (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), 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.

[0069] Those of ordinary skill in the art can understand that all or part of the processes in the methods of implementing the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a storage medium, and the storage medium is a computer-readable storage medium. The computer program is executed by at least one processor in the wireless communication system to implement the process steps of the embodiments of the above method.

[0070] 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 the computer program is executed by a processor, the processor is caused to execute any embodiment of the above-mentioned session processing method based on the CoAP protocol.

[0071] The storage medium may be a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk, an optical disk, or other computer-readable storage media that can store program codes.

[0072] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, wireless communication software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0073] In several embodiments provided by the present invention, 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 each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0074] The steps in the method embodiments of the present invention can be adjusted, combined, and deleted according to actual needs. The units in the system embodiments of the present invention can be combined, divided, and deleted according to actual needs. In addition, the functional units in each embodiment of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0075] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The wireless communication software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal wireless communication terminal, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.

[0076] In the above embodiments, the descriptions of each embodiment have their own emphases. For the parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0077] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, provided that these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.

[0078] As described above, the above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A session processing method based on the CoAP protocol, characterized in that, it includes: The terminal device obtains its own identification information, where the identification information includes the device IP and the terminal identifier; 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 reported resources according to the subscription information, and sends the reported resources, 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 second computing node in the Internet of Things platform decrypts the token value through a symmetric encryption algorithm to obtain the terminal identifier; The second computing node requests session information from the first computing node according to the terminal identifier; The second computing node receives the session information returned by the first computing node, reconstructs the session with the terminal device according to the session information, and processes the reported resources based on the reconstructed session; The Internet of Things platform further includes a load layer. 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 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; 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 the symmetric encryption algorithm; The first computing node splices a preset subscription identifier and the resource information to be subscribed to form subscription information, and sends the subscription information and the token value to the terminal device.

2. The session processing method based on the CoAP protocol according to claim 1, characterized in that, The terminal device obtains the changed device IP as the changed device IP, obtains the reported resources according to the subscription information, and sends the reported resources, 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, including: If the terminal device detects that the device IP has changed, it obtains the changed device IP as the changed device IP, parses the subscription information to obtain the resource information, and obtains the reported resources according to the resource information; Sends the reported resources, 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, where the second computing node and the first computing node are both located in the access layer of the Internet of Things platform.

3. The session processing method based on the CoAP protocol according to claim 1, characterized in that, After the second computing node receives the session information returned by the first computing node and reconstructs the session with the terminal device according to the session information, it further includes: The second computing node sends 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.

4. A session processing system based on the CoAP protocol, characterized in that, including: An acquisition unit, a sending unit, and an acquisition and sending unit configured in the terminal device, and a computing unit configured in the Internet of Things platform, where, The acquisition unit is used for the terminal device to obtain its own identification information, where 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 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 is used for the terminal device to obtain the changed device IP as the changed device IP, obtain the reported resources according to the subscription information, and send the reported resources, 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 decryption unit is used for the second computing node in the Internet of Things platform to decrypt the token value through a symmetric encryption algorithm to obtain the terminal identification; The request unit is used for the second computing node to request session information from the first computing node according to the terminal identification; The second reconstruction unit is used for the second computing node to receive the session information returned by the first computing node, reconstruct the session with the terminal device according to the session information, and process the reported resources based on the reconstructed session; The Internet of Things platform further includes a load layer, and the sending unit includes: A first sending subunit, used for the terminal device to send a login request carrying the identification information to the load layer; A second sending subunit, configured to send the login request to a first computing node corresponding to the device IP in the Internet of Things platform according to the device IP of the load layer, so that the first computing node establishes a session with the terminal device; The computing unit includes: A computing subunit, configured to calculate a token value by the first computing node in the Internet of Things platform according to the terminal identifier and the symmetric encryption algorithm; A splicing unit, configured to splice a preset subscription identifier and resource information to be subscribed by the first computing node to form subscription information, and send the subscription information and the token value to the terminal device.

5. A session processing system based on the CoAP protocol, characterized in that it includes a terminal device and an Internet of Things platform. Both the terminal device and the Internet of Things platform include a memory and a processor. A computer program is stored on the memory. When the processors of the terminal device and the Internet of Things platform execute the computer program, the method described in any one of claims 1-3 is implemented.

6. 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 described in any one of claims 1-3 can be implemented.

Citation Information

Patent Citations

  • Multi-server switching response method and device without re-login, computer equipment and computer readable storage medium

    CN116455659A