Real-time data processing method and device, terminal equipment and storage medium
By using message middleware and token information verification methods in the data gateway, the problems of data leakage and tampering during real-time data acquisition are solved, and the security and credibility of data are improved.
Patent Information
- Application Number
- CN202410906953.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-11-26
AI Technical Summary
In the process of real-time data collection, problems such as data leakage, tampering and loss have a significant impact on the production safety and commercial secrets of enterprises. How to effectively protect the real-time data of industrial enterprises has become an urgent problem to be solved.
By deploying clients and data centers in the data gateway and sending real-time data using preset message middleware, the data center performs verification after receiving token information and timestamps to ensure the source legitimacy and real-timeness of the data, thus Store and collect information to reduce the risk of data tampering.
It improves the credibility and integrity of the data, ensures the accuracy and security of the collected information stored in the data center, and reduces the risk of data being tampered with.
Smart Images

Figure CN119030735A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data security technology, and in particular, relates to a real-time data processing method, apparatus, terminal equipment and storage medium. Background Art
[0002] With the advent of the information age, data has become one of the core resources for the operation and management of industrial enterprises. As an important part of information management, real-time data collection plays a key role and provides real-time and accurate data support for enterprise decision-making.
[0003] In the process of real-time data collection from equipment, there are many challenges and risks, such as data leakage, tampering, loss, etc. These problems may have a significant impact on the company's production safety, business secrets, etc.
[0004] Therefore, how to effectively protect the real-time data collection of industrial enterprises has become one of the urgent issues that need to be solved in the current industrial sector. Summary of the invention
[0005] The embodiments of the present application provide a real-time data processing method, apparatus, terminal device and storage medium, which can improve the security and credibility of real-time data when a data gateway acquires real-time data.
[0006] In a first aspect, an embodiment of the present application provides a real-time data processing method, which is applied to a data gateway; the data gateway is deployed with a data center and a client connected to a device; the method includes:
[0007] The client sends real-time data to the data center through a preset message middleware; the real-time data includes token information and collection information for the device;
[0008] The data center stores the collected information when the token information passes the verification;
[0009] The token information is generated based on a first token corresponding to the device acquired by the client from a first database in real time, and a first timestamp corresponding to the collected information.
[0010] In a second aspect, an embodiment of the present application provides a real-time data processing device, which is applied to a data gateway; the data gateway is deployed with a data center and a client connected to a device; the device includes: a real-time data sending module located at the client, and a collection information storage module located at the data center;
[0011] The real-time data sending module is used to send real-time data to the data center through a preset message bus; the real-time data includes token information and collection information for the device;
[0012] The collected information storage module is used to store the collected information when the token information passes the verification;
[0013] The token information is generated based on a first token corresponding to the device acquired by the client from a first database in real time, and a first timestamp corresponding to the collected information.
[0014] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the real-time data processing method described in any one of the first aspects above when executing the computer program.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the real-time data processing method described in any one of the first aspects above is implemented.
[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the real-time data processing method described in any one of the above-mentioned first aspects.
[0017] Compared with the related art, the embodiments of the present application have the following beneficial effects:
[0018] The client can collect data from the device connected to it to obtain the collected information, and after generating token information based on the first token corresponding to the device obtained in real time from the preset first database and the first timestamp corresponding to the collected information, send the real-time data including the collected information and the token information to the data center through the message intermediate. There is a certain risk of tampering when the real-time data is sent to the data center through the message intermediate. After receiving the real-time data, the data center verifies the first token and the first timestamp in the token information. When the first token and the first timestamp pass the verification, the data center stores the collected information in the real-time data, thereby reducing the occurrence of the data center storing the tampered collected information and improving the credibility and integrity of the stored collected information. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 This is a schematic diagram of a data gateway framework provided by an embodiment of the present application;
[0021] Figure 2 is a schematic diagram of a real-time data processing method provided in an embodiment of the present application;
[0022] Figure 3 This is another data gateway framework schematic diagram provided in an embodiment of the present application;
[0023] Figure 4 This is a flow chart of a main program generating a token provided by an embodiment of the present application;
[0024] Figure 5 This is a client workflow diagram provided by an embodiment of the present application;
[0025] Figure 6 This is a data center workflow diagram provided by an embodiment of the present application;
[0026] Figure 7 is a schematic diagram of a real-time data processing method provided in an embodiment of the present application;
[0027] Figure 8 This is a data gateway workflow diagram provided by an embodiment of the present application;
[0028] Fig. 9 is a structural diagram of a real-time data processing device provided in an embodiment of the present application;
[0029] Fig.10 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0031] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0032] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0033] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" 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 "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0034] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0035] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0036] The technical solution of the present application is described below through specific embodiments.
[0037] Reference Figure 1 , showing a schematic diagram of a data gateway framework provided by an embodiment of the present application; a client, a data center, and a first database for connecting and communicating with a device are deployed in the data gateway; one or more clients can be deployed in the data gateway, and a client can connect and communicate with one or more devices, and the client is an application for collecting device-related information. Exemplarily, device-related information may include information related to device operation, such as operating status, operating time, operating result information, operating process information, and information related to device operation, such as device identification and specifications. The first database stores data accessible to the data center and the client.
[0038] Reference Figure 2 , shows a schematic diagram of a real-time data processing method provided by an embodiment of the present application, and the real-time data processing method can be applied to Figure 1 The data gateway shown in the figure may specifically include the following steps:
[0039] Step 201, the client sends real-time data to the data center through a preset message middleware;
[0040] The above-mentioned real-time data includes token information and collection information of the device connected to the client.
[0041] The client can collect data about the device in real time and obtain the collected information. The content of the collected information and the collection frequency can be determined according to the pre-set rules. For example: the client collects data from the device connected to it every hour, and uses the operation result data of the device as the collected information.
[0042] The client transmits real-time data to the data center through the message middleware. During the transmission process, the real-time data is at risk of being tampered with. By adding token information to the real-time data, the data center can identify whether the real-time data it receives is true and accurate through the token information.
[0043] Exemplarily, the message middleware is a message queue adapted to MQTT (Message Queuing Telemetry Transport). It is understandable that MQTT is only an example of an embodiment of the present application, and the embodiment of the present application can also be applied to the scenario where the client sends real-time data to the data center through other message middleware.
[0044] The above-mentioned token information is generated based on the first token corresponding to the device obtained by the client in real time from the preset first database, and the first timestamp corresponding to the collected information. The first database stores the token corresponding to the device, and the token can be a character string determined according to the preset rules of the token. The first token is the token obtained by the client. The client can access the first database to obtain the token currently recorded in the first database corresponding to the device for which the client is collecting data. The first timestamp is determined by the time when the client obtains the collected information.
[0045] Step 202, the data center stores the collected information when the token information passes the verification;
[0046] After receiving the real-time data, the data center verifies the token information, including double verification of the first token and the first timestamp in the token information. When both the first token and the first timestamp pass the verification, the data center stores the collected information. By verifying the first token, it is ensured that the real-time data comes from a legitimate client, and by verifying the first timestamp, the real-time and accuracy of the real-time data is ensured, which improves the credibility and integrity of the real-time data, and improves the accuracy of the data center in identifying whether the real-time data has been tampered with.
[0047] Exemplarily, when either the first token or the first timestamp fails to pass the verification of the data center, the data center does not store the collected information, thereby preventing the data center from storing and processing the collected information that has certain risks.
[0048] In the embodiment of the present application, the client in the data gateway and the data center transmit data through a message middleman. The client can collect data from the device connected to it to obtain collected information, and after generating token information based on the first token corresponding to the device obtained in real time from the preset first database and the first timestamp corresponding to the collected information, the real-time data including the collected information and the token information is sent to the data center through the message middleman. There is a certain risk of tampering when the real-time data is sent to the data center through the message middleman. After receiving the real-time data, the data center verifies the first token and the first timestamp in the token information. When the first token and the first timestamp are both verified, the data center stores the collected information in the real-time data, thereby reducing the occurrence of the data center storing tampered collected information and improving the credibility and integrity of the stored collected information.
[0049] In some optional embodiments of the present application, before step 201, the real-time data processing method may further include:
[0050] The client determines whether to encrypt the real-time data based on the preset configuration information; if so, the real-time data is encrypted.
[0051] When deploying a data gateway, you can set configuration information, which can record the collected information that needs to be encrypted. For collected information that cannot be made public, the client needs to encrypt the real-time data before sending it to prevent real-time data leakage. For publicly available collected information, the client can send real-time data without encryption to improve the transmission efficiency of real-time data.
[0052] The configuration information may also be provided with an encapsulation format, and the client may process the real-time data according to the encapsulation format recorded in the configuration information to obtain a data packet in the encapsulation format, and transmit the real-time data in the form of a data packet.
[0053] Reference Figure 3 , shows another data gateway framework schematic diagram provided by an embodiment of the present application; in some optional embodiments of the present application, the data gateway is also deployed with a main program and a second database; the main program is used to manage the client, the data center, the first database and the second database, and the second database is used to store the collected information. Before the client sends the real-time data to the data center through the preset message middleware, the real-time data processing method also includes: the client sends a registration request to the main program; the registration request includes a device identifier; the main program generates a corresponding token based on the device identifier.
[0054] After the client is connected to the device, the device identifier corresponding to the device can be determined. Before the client sends the real-time data of the device, it is necessary to initiate a registration request to the main program to register for the device. After the main program receives the registration request containing the device identifier, it can generate a token in a specified manner (for example, based on JWT technology). The generated token can be stored in the first database, and the data center can verify the token information in the real-time data through the token in the first database.
[0055] In some optional embodiments of the present application, the real-time data processing method further includes: the main program encrypts the token and stores it in the first database; the main program updates the token in the first database at a preset frequency.
[0056] The main program can encrypt the generated token, and store it in the first database with the device information and the encrypted token as a key-value pair. The client and the data center can determine the token corresponding to the device identification of any registered device. By encrypting and storing the token, it can prevent the token from being accidentally leaked and used by a third party, which would cause potential risks to the data gateway. To further improve the security of real-time data, the main program can also update the tokens in the first database at a certain frequency. Even if the token is leaked at a certain moment, the third party can only use it within a limited time, thereby reducing potential security risks. At the same time, by updating the token at a preset frequency, the tokens obtained by the client for the same device identification at different times are not necessarily the same. Based on this, the authenticity of the real-time data output by the client can be verified using the tokens in the first database.
[0057] For example, the main program may update the tokens in the first database at a frequency of once every 30 minutes, that is, the main program may update the corresponding token for the same device identification at a frequency of once every 30 minutes.
[0058] Reference Figure 4 , shows a schematic diagram of a flow chart of a main program generating a token provided by an embodiment of the present application; in one example, the steps of the main program generating a token include:
[0059] Step 401, obtaining a device identification.
[0060] Step 402, generate a token.
[0061] Step 403, encrypt the token.
[0062] Step 404: store the encrypted token in the first database.
[0063] Step 405, determine whether the encrypted token has been stored in the first database for more than one hour, if so, return to step 401. In this example, the main program updates the token once an hour, and updates the token when the storage time of the currently stored token in the first database reaches one hour.
[0064] In some optional embodiments of the present application, before the client sends real-time data to the data center through a preset message middleware, the real-time data processing method also includes: the client obtains a first token corresponding to the device from a first database in real time; the client determines a first timestamp when obtaining the collected information; and the client generates token information based on the first token and the first timestamp.
[0065] When the client obtains the collected information, the first token corresponding to the device identifier corresponding to the collected information is obtained from the first database in real time. When the client obtains the collected information, the current time is determined to be the first timestamp. The client generates token information based on the first token and the first timestamp, thereby generating token information containing two dimensional features of token and time, so that when the token information is subsequently received in the data center, the token information can be verified in two dimensions.
[0066] In the related art, the token information in the real-time data only contains the token, and the real-time data receiving end can only perform a single-dimensional check on the token information. At the same time, since the token information in the embodiment of the present application adds a first timestamp of the time dimension, even if the real-time data is intercepted by a third party, since the third party is not aware that the token information contains the timestamp, the third party cannot accurately identify the content of the token information, further preventing the token of the device identification pair from being accidentally leaked, and improving the security and credibility of the real-time data transmission in the embodiment of the present application.
[0067] In some optional embodiments of the present application, the above-mentioned step of generating token information based on the first token and the first timestamp includes: encrypting the first timestamp to generate an encrypted timestamp; splicing the first token and the encrypted timestamp to generate token information.
[0068] After obtaining and determining the first timestamp, the client can call a preset algorithm (for example, AES (Advanced Encryption Standard), Base64, etc.) to encrypt the first timestamp to obtain an encrypted timestamp, and concatenate the first token and the encrypted timestamp to obtain token information.
[0069] In some optional embodiments of the present application, the above-mentioned step of splicing the first token and the encrypted timestamp to generate token information includes: determining the splicing characters; combining the splicing characters, the first token and the encrypted timestamp to generate token information.
[0070] As an example, the splicing character can be preset, for example, the splicing character is preset in each client in the data gateway, and when the client needs to generate token information, the splicing character is read. Then, the first token and the encrypted timestamp can be spliced together to obtain the token information through the splicing character, and the data center can accurately identify the first token and the encrypted timestamp in the token information through the splicing character.
[0071] In actual applications, the data gateway can also update the splicing characters at a certain frequency. At the same time, the updated splicing characters can be recognized by the digital center and accurately parse the first token and the encrypted timestamp. Since the data gateway can update the splicing characters, the risk of a third party trying to tamper with the token information to make the real-time data pass the data center verification after the real-time data is leaked is reduced.
[0072] In some optional embodiments of the present application, in the token information, the splicing character is located between the first token and the encryption timestamp.
[0073] For example, if the concatenation character is "#", then token information such as "XXXXXX#YYYYYYYYY" can be obtained through concatenation, where "XXXXXX" is the first token and "YYYYYYYYY" is the encrypted timestamp. It should be noted that "XXXXXX" and "YYYYYYYYY" are simply described for the purpose of illustration only, and "XXXXXX" cannot be understood as a limitation on the first token. Similarly, "YYYYYYYYY" cannot be understood as a limitation on the encrypted timestamp. Both the first token and the encrypted timestamp can be composed of any characters of any length.
[0074] In some other embodiments, the timestamp included in the token information is not encrypted, and the token information can also be generated by splicing the first token and the first timestamp using splicing characters.
[0075] The embodiment of the present application does not limit the type of spliced characters (including but not limited to symbols, letters, and numbers) and the length of the spliced characters.
[0076] In some optional embodiments of the present application, the real-time data also includes a second timestamp and a device identifier; the method also includes: the data center determines a second token corresponding to the device identifier from the first database; the data center parses the token information to obtain the first token and the first timestamp; the data center determines that the token information passes the verification when the first timestamp is the same as the second timestamp and the first timestamp is the same as the second timestamp.
[0077] The second timestamp is an unencrypted timestamp corresponding to the collected information. Usually, the real-time data packet needs to contain the original time information (equivalent to the second timestamp in the embodiment of the present application). When a third party tampers with the real-time data, it will tamper with the time information to reduce the recognition that the real-time data has been tampered with. The embodiment of the present application can verify whether the second timestamp in the real-time data has been tampered with based on the first timestamp in the token information to identify whether the real-time data is at risk of being tampered with. Further, the first token in the token information is verified to identify whether the real-time data is reliable. Specifically:
[0078] After receiving the real-time data, the data center can extract the device identifier in the real-time data, determine whether there is a token corresponding to the device identifier in the first database, and use the token corresponding to the device identifier determined from the first database as the second token. Parse the token information in the real-time data packet to obtain the first token and the first timestamp previously obtained by the client from the first database. It is understandable that when the token information contains an encrypted timestamp, the data center can decrypt the encrypted timestamp to obtain the first timestamp.
[0079] The data center compares the first token with the second token, and compares the first timestamp with the second timestamp. When the first token is the same as the second token, and the first timestamp is the same as the second timestamp, it is determined that the token information has passed the verification, and further it can be determined that the source of the real-time data is reliable and timely.
[0080] Reference Figure 5 , shows a client workflow diagram provided by an embodiment of the present application; the client work process includes:
[0081] Step 501: Collect data: Get the collected information of the connected device.
[0082] Step 502: Read the first database. According to the device identification corresponding to the collected information, read the corresponding first token from the first database.
[0083] Step 503, obtaining and encrypting a first timestamp: determining a first timestamp corresponding to the collected information, and encrypting the first timestamp to obtain an encrypted timestamp.
[0084] Step 504: Generate token information. The token information is obtained by concatenating the first token and the encrypted timestamp through concatenating characters.
[0085] Step 505: Encapsulate the data packet. Encapsulate the real-time data according to a preset format.
[0086] Step 506, determine whether to encrypt the data packet. If yes, execute steps 507-508, if not, execute step 508.
[0087] Step 507: encrypt the data packet.
[0088] Step 508: Upload the data packet. Upload the data packet to the message middleman so that the data center can obtain the data packet through the message middleman.
[0089] Reference Figure 6 , shows a data center workflow diagram provided by an embodiment of the present application; the data center work process includes:
[0090] Step 601, receiving a data packet: receiving a data packet sent by a client from an intermediate message body.
[0091] Step 602, determine whether the data packet needs to be decrypted. If yes, execute step 603, if not, execute step 604.
[0092] Step 603, decrypt the data packet.
[0093] Step 604: parse the token information to obtain a first token and a first timestamp.
[0094] Step 605: Read the first database to obtain a second token. Obtain the corresponding second token from the first database according to the device identifier in the data packet.
[0095] Step 606, determine whether the first token and the second token are consistent, if so, execute step 607, if not, execute step 609.
[0096] Step 607, determine whether the first timestamp and the second timestamp are consistent; the second timestamp is obtained by reading the data packet. If yes, execute step 608, if not, execute step 609.
[0097] Step 608: Store data. The data packet including but not limited to the collected information is stored.
[0098] Step 609: End. The processing of the received data packet ends.
[0099] In another example, the data center performs steps 606 and 607 simultaneously, and performs step 608 when the first token and the second token are consistent and the first timestamp and the second timestamp are consistent, otherwise, performs step 609.
[0100] Alternatively, the data center may first determine whether the first timestamp and the second timestamp are consistent, and when the first timestamp and the second timestamp are consistent, determine whether the first token and the second token are consistent, and execute step 609 when the first token and the second token are consistent.
[0101] Combined with the above client and data center workflow, refer to Figure 7 , shows a flow chart of a real-time data processing method provided in an embodiment of the present application, including: steps 701-703 executed by the client, and steps 704-708 executed by the data center.
[0102] Step 701: Data collection: Acquire the collection information of the connected device.
[0103] Step 702, read the first database and encapsulate the data packet.
[0104] Step 703, upload the data package.
[0105] Step 704: Receive a data packet and read the first database.
[0106] Step 705: Verify the token information. If the token information passes the verification, execute step 706; if the token information fails the verification, execute step 707.
[0107] Step 706: Data storage. The data package including but not limited to the collected information is stored in the second database.
[0108] Step 707: Return an error result. Feedback the error result to the main program and / or the client to indicate that the data packet is wrong.
[0109] Step 708, end.
[0110] Reference Figure 8 , shows a data gateway workflow diagram provided in an embodiment of the present application; comprising the following steps:
[0111] Step 801, generate a token.
[0112] Step 802: read the first database and generate token information and a data packet. The client sends the data packet to the data center.
[0113] Step 803: read the first database to determine the second token.
[0114] Step 804, verifying the token information. When the first token and the second token are consistent and the first timestamp and the second timestamp are consistent, it is determined that the token information has passed the verification. If the token information has passed the verification, step 805 is executed; if the token information has not passed the verification, step 806 is executed.
[0115] Step 805: Data storage: The data package including but not limited to the collected information is stored in the second database.
[0116] Step 806: Data discarded: Data packets whose token information fails to pass verification are discarded.
[0117] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0118] Reference Fig. 9 , shows a schematic diagram of a real-time data processing device provided in an embodiment of the present application, which is applied to a data gateway; the data gateway is deployed with a data center and a client connected to the device; the device includes: a real-time data sending module 901 located at the client, and a collection information storage module 902 located at the data center;
[0119] The real-time data sending module 901 is used to send real-time data to the data center through a preset message bus; the real-time data includes token information and collection information for the device;
[0120] The collected information storage module 902 is used to store the collected information when the token information passes the verification;
[0121] The token information is generated based on a first token corresponding to the device obtained by the client in real time from a preset first database, and a first timestamp corresponding to the collected information.
[0122] In some optional embodiments of the present application, the data gateway is also deployed with a main program; the device also includes: a registration request module located at the client, and a token generation module located at the main program;
[0123] A registration request module is used to send a registration request to the main program; the registration request includes a device identifier;
[0124] The token generation module is used to generate a corresponding token according to the device identification.
[0125] In some optional embodiments of the present application, the device further comprises: a token storage module and a token update module located in the main program;
[0126] A token storage module, used for encrypting the token and storing it in the first database;
[0127] The token updating module is used by the main program to update the tokens in the first database at a preset frequency.
[0128] In some optional embodiments of the present application, before the client sends real-time data to the data center through the preset message middleware, the device further includes: a first token acquisition module, a first timestamp determination module, and a token information generation module located at the client;
[0129] A first token acquisition module, used to acquire a first token corresponding to the device from a first database in real time;
[0130] A first timestamp determination module, used to determine a first timestamp when acquiring the collected information;
[0131] The token information generation module is used to generate token information based on the first token and the first timestamp.
[0132] In some optional embodiments of the present application, the token information generation module includes:
[0133] A timestamp encryption submodule, used for encrypting the first timestamp to generate an encrypted timestamp;
[0134] The token information generation submodule is used to concatenate the first token and the encrypted timestamp to generate token information.
[0135] In some optional embodiments of the present application, the real-time data further includes a second timestamp and a device identifier; the apparatus further includes a second token acquisition module, a token information parsing module, and a verification module located in the data center;
[0136] A second token acquisition module, used to determine a second token corresponding to the device identifier from the first database;
[0137] A token information parsing module, used for parsing the token information to obtain a first token and a first timestamp;
[0138] The verification module is used to determine that the token information passes the verification when the first timestamp is the same as the second timestamp and the first timestamp is the same as the second timestamp.
[0139] In some optional embodiments of the present application, the device further comprises: a real-time data encryption module located at the client;
[0140] The data encryption module is used to determine whether to encrypt the real-time data based on the preset configuration information; if so, encrypt the real-time data.
[0141] An embodiment of the present application provides a data processing device, and by using the device, each step in the aforementioned method embodiments can be implemented.
[0142] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.
[0143] Reference Fig.10 , shows a schematic diagram of a terminal device provided in an embodiment of the present application. Fig.10 As shown, the terminal device 1000 in the embodiment of the present application includes: a processor 1010, a memory 1020, and a computer program 1021 stored in the memory 1020 and executable on the processor 1010. When the processor 1010 executes the computer program 1021, the steps in each embodiment of the above-mentioned real-time data processing method are implemented, such as Figure 2 Alternatively, when the processor 1010 executes the computer program 1021, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Fig. 9 Functions of modules 901 to 902 are shown.
[0144] Exemplarily, the computer program 1021 may be divided into one or more modules / units, which are stored in the memory 1020 and executed by the processor 1010 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which may be used to describe the execution process of the computer program 1021 in the terminal device 1000. For example, the computer program 1021 may be divided into a real-time data transmission module and a collection information storage module, and the specific functions of each module are as follows:
[0145] A real-time data sending module is used to send real-time data to the data center through a preset message bus; the real-time data includes token information and collection information for the device;
[0146] A collection information storage module is used to store the collection information when the token information passes the verification;
[0147] The token information is generated based on a first token corresponding to the device obtained by the client in real time from a preset first database, and a first timestamp corresponding to the collected information.
[0148] The terminal device 1000 may be a computing device such as a desktop computer or a server. The terminal device 1000 may include, but is not limited to, a processor 1010 and a memory 1020. Those skilled in the art will appreciate that Fig.10It is only an example of the terminal device 1000 and does not constitute a limitation of the terminal device 1000. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device 1000 may also include input and output devices, network access devices, buses, etc.
[0149] The processor 1010 may be a central processing unit (CPU), or 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. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0150] The memory 1020 may be an internal storage unit of the terminal device 1000, such as a hard disk or memory of the terminal device 1000. The memory 1020 may also be an external storage device of the terminal device 1000, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 1000. Further, the memory 1020 may also include both an internal storage unit of the terminal device 1000 and an external storage device. The memory 1020 is used to store the computer program 1021 and other programs and data required by the terminal device 1000. The memory 1020 may also be used to temporarily store data that has been output or is to be output.
[0151] The embodiment of the present application further discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the real-time data processing method as described in the above embodiments is implemented.
[0152] The embodiment of the present application further discloses a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the real-time data processing method described in the above-mentioned embodiments.
[0153] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0154] Those of ordinary skill 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, or a combination of computer software and electronic hardware. 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 this application.
[0155] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0156] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0157] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A real-time data processing method, characterized in that: Applied to data gateways; The data gateway is deployed with a data center and a client connected to the device; the method includes: The client sends real-time data to the data center through a preset message middleware; the real-time data includes token information and collection information for the device; The data center stores the collected information when the token information passes the verification; The token information is generated based on a first token corresponding to the device acquired by the client in real time from a preset first database, and a first timestamp corresponding to the collected information.
2. The method according to claim 1, characterized in that The data gateway is also deployed with a main program; before the client sends real-time data to the data center through a preset message middleware, the method further includes: The client sends a registration request to the main program; the registration request includes a device identifier; The main program generates a corresponding token according to the device identification.
3. The method according to claim 2, characterized in that The method further comprises: The main program encrypts the token and stores it in the first database; The main program updates the tokens in the first database at a preset frequency.
4. The method according to claim 1, characterized in that: Before the client sends the real-time data to the data center through the preset message middleware, the method further includes: The client obtains a first token corresponding to the device from the first database in real time; The client determines a first timestamp when acquiring the collected information; The client generates token information based on the first token and the first timestamp.
5. The method according to claim 4, characterized in that The generating token information based on the first token and the first timestamp includes: Encrypting the first timestamp to generate an encrypted timestamp; The first token and the encrypted timestamp are concatenated to generate token information.
6. The method according to claim 4, characterized in that The real-time data also includes a second timestamp and a device identifier; the method also includes: The data center determines a second token corresponding to the device identifier from the first database; The data center parses the token information to obtain the first token and the first timestamp; The data center determines that the token information passes verification when the first timestamp is the same as the second timestamp and the first timestamp is the same as the second timestamp.
7. The method according to claim 4, characterized in that Before the client sends the real-time data to the data center through the preset message middleware, the method further includes: The client determines whether to encrypt the real-time data according to the preset configuration information; if so, encrypts the real-time data.
8. A real-time data processing device, characterized in that: Applied to data gateways; The data gateway is deployed with a data center and a client connected to the device; the device includes: a real-time data sending module located at the client, and a collection information storage module located at the data center; The real-time data sending module is used to send real-time data to the data center through a preset message bus; the real-time data includes token information and collection information for the device; The collected information storage module is used to store the collected information when the token information passes the verification; The token information is generated based on a first token corresponding to the device acquired by the client in real time from a preset first database, and a first timestamp corresponding to the collected information.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
