Order data processing method, server, storage medium and program product
Through direct communication between online and offline order systems and using digital signature technology, the intermediate business layer has been solved to increase development workload and data security issues, achieving efficient and secure order data synchronization.
Patent Information
- Application Number
- CN202111525395.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2041-12-14
AI Technical Summary
In the prior art, the addition of the intermediate business layer has increased the development workload, and the order data is easily tampered with during processing and distribution, which cannot effectively ensure the security of the order data.
By directly establishing a communication connection between the online order system and the offline order system, digital signature technology is used to ensure data security. The specific steps include monitoring order data updates, performing digital signature processing, pushing signed data to another system, performing sign verification processing and synchronous update of data.
No intermediate business layer involves participation, which reduces development workload and effectively ensures the security of order data through digital signature technology.
Smart Images

Figure CN114219565B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular, to an order data processing method, a server, a storage medium, and a program product. Background Art
[0002] With the continuous development of the physical industry and e-commerce platforms, both online and offline sales channels have specific audiences, so they have achieved continuous development. However, the online and offline systems are currently incompatible with each other, so the order data of the goods can only be presented in their respective systems. This has resulted in customers being unable to view offline order data in the online order system, nor in the online order system. In this era of interconnectedness, the situation where order data in the online order system and the offline order system are not connected needs to be solved urgently.
[0003] At present, in order to make the order data between the online order system and the offline order system interoperable, an intermediate business layer for data encapsulation is added between the online order system and the offline order system. Order data is processed and distributed in the intermediate business layer to ensure the interoperability of order data between the two systems. However, due to the addition of the intermediate business layer, the development workload is increased, and the order data is easily tampered with during data processing and distribution, and the security of the order data cannot be effectively guaranteed. Summary of the invention
[0004] The embodiments of the present invention provide an order data processing method, a server, a storage medium and a program product, which are used to solve the technical problems in the prior art that the development workload is increased due to the addition of the intermediate business layer, and the order data is easily tampered with during data processing and distribution, and the security of the order data cannot be effectively guaranteed.
[0005] In a first aspect, an embodiment of the present invention provides an order data processing method, the method being applied in a server of a first order system, the method comprising:
[0006] Monitor whether order data is updated;
[0007] If an update of the order data is detected, the updated order data will be digitally signed to obtain the signed order data;
[0008] Pushing the signed order data to a second order system so that the second order system verifies the signed order data and synchronously updates the updated order data after the verification, wherein the first order system is one of the online order system and the offline order system, and the second order system is the other of the online order system and the offline order system;
[0009] Receive the push result sent by the second order system.
[0010] In a second aspect, an embodiment of the present invention provides an order data processing method, which is applied to a server of a second order system, and includes:
[0011] Receiving the signed order data sent by the first order system; the signed order data is obtained after the first order system detects an update of the order data and performs digital signature processing on the updated order data;
[0012] Performing signature verification on the signed order data, and synchronously updating the updated order data after the signature verification is passed;
[0013] Send push results to the first order system.
[0014] In a third aspect, an embodiment of the present invention provides an order system server, comprising: at least one processor, a memory, and a transceiver;
[0015] The processor, the memory and the transceiver circuit are interconnected;
[0016] The memory stores computer-executable instructions; the transceiver is used to send and receive data;
[0017] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to the first aspect or the second aspect.
[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect or the second aspect.
[0019] The order data processing method, server, storage medium and program product provided by the embodiment of the present invention are applied to the first order system in the electronic device through the method, by monitoring whether the order data is updated; if the order data is updated, the updated order data is digitally signed to obtain the signed order data; the signed order data is pushed to the second order system so that the second order system verifies the signed order data, and synchronizes the updated order data after the verification, the first order system is one system of the online order system and the offline order system, and the second order system is another system of the online order system and the offline order system; the push result sent by the second order system is received. Since the online order system and the offline order system communicate directly and synchronize the online order data and the offline order, there is no need for the participation of the intermediate business layer, which reduces the development workload of the intermediate business layer. And before the first order system pushes the updated order data to the second order system, the updated order data is digitally signed to obtain the signed order data, so the security of the order data is effectively guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0021] Figure 1 This is an application scenario diagram that can implement the order data processing method of the embodiment of the present invention;
[0022] Figure 2 It is a detailed application scenario diagram that can implement the order data processing method of the embodiment of the present invention;
[0023] Figure 3 It is another detailed application scenario diagram that can implement the order data processing method of the embodiment of the present invention;
[0024] Figure 4 It is a flowchart of an order data processing method provided by an embodiment of the present invention;
[0025] Figure 5 is a flow chart of an order data processing method provided by another embodiment of the present invention;
[0026] Figure 6 is a schematic diagram of a digital signature in an order data processing method provided by another embodiment of the present invention;
[0027] Figure 7 is a flowchart of an order data processing method provided by another embodiment of the present invention;
[0028] Figure 8 is a flowchart of an order data processing method provided by another embodiment of the present invention;
[0029] Fig. 9 is a flowchart of an order data processing method provided by yet another embodiment of the present invention;
[0030] Fig.10 is a schematic diagram of signature verification in an order data processing method provided in yet another embodiment of the present invention;
[0031] Fig.11 is a flowchart of an order data processing method provided by another embodiment of the present invention;
[0032] Fig.12 It is a structural diagram of a server of an order system for implementing the order data processing method according to an embodiment of the present invention;
[0033] Fig.13 It is a block diagram of a server of an order system used to implement the order data processing method according to an embodiment of the present invention.
[0034] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0035] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0036] First, the terms involved in the embodiments of the present invention are explained:
[0037] WebSocket: is a protocol for full-duplex communication over a single TCP connection, which makes data interaction between the client and the server easier and allows the server to actively push data to the client.
[0038] Redis: is a high-performance key-value database. The emergence of redis has largely compensated for the shortcomings of key / value storage such as memcached, and can play a good complementary role to relational databases in some situations. Redis supports master-slave synchronization. Data can be synchronized from the master server to any number of slave servers, and the slave server can be a master server associated with other slave servers. This allows Redis to perform single-layer tree replication. Data can be written intentionally or unintentionally when saving to disk. Since the publish / subscribe mechanism is fully implemented, when the slave database synchronizes the tree anywhere, it can subscribe to a channel and receive the complete message publishing record of the master server. Synchronization is very helpful for the scalability of read operations and data redundancy.
[0039] Digital signature: It is a string of numbers that can only be generated by the sender of the information and cannot be forged by others. This string of numbers is also a valid proof that the sender of the information is authentic.
[0040] In order to clearly understand the technical solution of the present application, the solution of the prior art is introduced in detail.
[0041] At present, in order to make the order data of the online order system and the offline order system interoperable, an intermediate business layer for data encapsulation is added to the online order system and the offline order system. That is, the intermediate business layer interacts with the online order system and the offline order system respectively, and processes and distributes the order data in the intermediate business layer to ensure the interoperability of the order data between the two systems. However, due to the addition of the intermediate business layer, when developing the intermediate business layer, developers need to carry out corresponding development according to the functions of the intermediate business layer, which increases the workload of development, and when processing and distributing data, the order information is not protected, which makes the order data easy to be tampered with, and the security of the order data cannot be effectively guaranteed.
[0042] Therefore, when facing the technical problems of the prior art, the inventor found through creative research that in order to reduce the workload of development, a communication connection can be directly established between the online order system and the offline order system, and the synchronization, integration and unified management of online order data and offline orders can be achieved through direct interaction between the online order system and the offline order system. Specifically, one order system of the online order system and the offline order system monitors whether the order data is updated. If the order data is updated, the updated order data is pushed to the other order system of the online order system and the offline order system. The other order system synchronizes and updates the updated order data and sends the push result to one order system. In order to effectively ensure the security of the order data, one order system of the online order system and the offline order system digitally signs the updated order data before pushing the updated order data to the other order system to obtain the signed order data. Then, after receiving the signed order data, the other order system verifies the signed order data, and synchronizes and updates the updated order data after the verification.
[0043] Therefore, based on the above creative findings, the inventors have proposed a technical solution of the embodiment of the present invention. The network architecture and application scenarios of the order data processing method provided by the embodiment of the present invention are introduced below.
[0044] Figure 1 is an application scenario diagram that can implement the order data processing method of the embodiment of the present invention, such as Figure 1 As shown, the network architecture of the order data processing method provided in this embodiment includes an offline user terminal 11 and an offline server 12 corresponding to the offline order system, and an online user terminal 13 and an online server 14 corresponding to the online order system. The offline user interacts with the client of the offline user terminal 11 to place an order or modify an order. The online user interacts with the client of the online user terminal 13 to place an order online or modify an order. The offline user terminal 11 interacts with the offline server 12 to update the order data on the offline server 12. The online user terminal 13 interacts with the online server 14 to update the order data on the online server 14. The online server 12 and the offline server 13 are directly connected in communication, and the server of each order system monitors whether the order data is updated. If the order data is updated, the updated order data is digitally signed to obtain the signed order data, and the signed order data is pushed to the server of another order system. The server of another order system verifies the signed order data, and synchronously updates the updated order data after the verification.
[0045] In more detailed application scenarios, such as Figure 2As shown, in the offline order system, the counter staff assists offline users to place orders. If the offline order system monitors the update of order data, the offline order system creates new order data. And pushes the signed order data to the online order system. After the online order system verifies the signed order data, it simultaneously creates new order data and feeds back the push result to the offline order system. If it is detected that the order data in the offline order system has been modified, it also means that the order data has been updated, and the signed order data is pushed to the online order system. After the online order system verifies the signed order data, it synchronously updates the order data and feeds back the push result to the offline order system. Among them, the signed order data is obtained by digitally signing the updated order data.
[0046] In another more detailed application scenario, such as Figure 3 As shown, in the online order system, users place orders independently. If the online order system monitors the update of order data, the online order system will create new order data. And push the signed order data to the offline order system. After the offline order system verifies the signed order data, it will simultaneously create new order data and feedback the push result to the online order system. If it is detected that the order data in the online order system has been modified, it also means that the order data has been updated, and the signed order data will be pushed to the offline order system. After the offline order system verifies the signed order data, it will synchronously update the order data and feedback the push result to the online order system.
[0047] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0048] Embodiment 1
[0049] Figure 4 is a flow chart of an order data processing method provided by an embodiment of the present invention, such as Figure 4 As shown, the execution subject of the order data processing method provided in this embodiment is an order data processing device. The order data processing device is located in the server of the first order system. Then the order data processing method provided in this embodiment includes the following steps:
[0050] Step 201, monitoring whether order data is updated.
[0051] In this embodiment, the first order system is one of the online order system and the offline order system, and the second order system is the other of the online order system and the offline order system.
[0052] The order data is the order data generated by the user placing an order for goods in the first order system. The type of goods is not limited. For example, it can be precious metals in the financial field, or daily necessities. The order data may include order code, order status, recipient information, etc.
[0053] In this embodiment, when a user performs order data related operations on the client of the first order system, such as placing an order, modifying an order, etc., the user terminal loaded with the first order system sends an order data update request to the server, and the order data update request carries the order code, update type, and update data, etc. The server updates the order data accordingly according to the order data update request. For example, for an order placement operation, the server creates new order data. For an order modification operation, the server modifies the corresponding order data.
[0054] Therefore, in this embodiment, the server monitors whether the order data is updated by determining whether it updates the order data accordingly according to the order data update request.
[0055] Step 202: If an update of the order data is detected, the updated order data is digitally signed to obtain the signed order data.
[0056] In this embodiment, if the creation of order data or the modification of order data is detected, it is determined that the update of order data is detected. After the update of order data is detected, the updated order data is obtained, and the updated order data is digitally signed using a preset encryption algorithm and hash function, and the digitally signed order data is determined as the signed order data.
[0057] Step 203: Push the signed order data to the second order system so that the second order system can verify the signed order data and synchronously update the updated order data after the verification.
[0058] In this embodiment, the server of the first order system communicates with the server of the second order system to push the signed order data to the second order system. The server corresponding to the second order system can perform signature verification on the signed order data according to the decryption algorithm and the hash function to obtain the signature verification result. After the signature verification result is passed, the updated order data after the signature verification is passed is obtained, and the updated order data is synchronously updated in the server of the second order system according to the update type of the updated order data.
[0059] Exemplarily, if the update type of the updated order data is a create type, the order data is created in the server of the second order system. If the update type of the updated order data is a modify type, the order data is modified in the server of the second order system.
[0060] It is understandable that both the first order system server and the second order system server have a database for storing order data, so when the second order system synchronously updates the updated order data, the updated order data can be synchronously updated in the database of the second order system server.
[0061] Step 204, receiving the push result sent by the second order system.
[0062] In this embodiment, after the second order system synchronizes and updates the updated order data, if the synchronization update result is a successful update result, the push result of the successful update is pushed to the first order system. If the synchronization update result is an update failure result, the push result of the failed update is pushed to the first order system, and the reason for the update failure can be included in the push result.
[0063] The order data processing method provided in this embodiment monitors whether the order data is updated; if the order data is updated, the updated order data is digitally signed to obtain the signed order data; the signed order data is pushed to the second order system so that the second order system verifies the signed order data and synchronizes the updated order data after the verification, the first order system is one of the online order system and the offline order system, and the second order system is another of the online order system and the offline order system; the push result sent by the second order system is received. Since the online order system and the offline order system communicate directly and synchronize the online order data and the offline order, there is no need for the participation of the intermediate business layer, which reduces the development workload of the intermediate business layer. And before the first order system pushes the updated order data to the second order system, it digitally signs the updated order data to obtain the signed order data, so the security of the order data is effectively guaranteed.
[0064] Embodiment 2
[0065] Figure 5 FIG. 1 is a flow chart of an order data processing method provided by another embodiment of the present invention. Figure 5 As shown, the order data processing method provided in this embodiment further refines step 202, and step 202 of the order data processing method provided in this embodiment includes the following steps:
[0066] Step 301, encrypt the updated order data to obtain encrypted ciphertext.
[0067] The updated order data may include the number of the updated order data and the type of update. The number of the order data is information indicating a unique order, and the type of update may be any one of a creation type and a modification type. If the type of update is a modification type, specific updated data may also be included. For example, the specific updated data may be order status, consignee information, etc.
[0068] Specifically, in this embodiment, Figure 6 As shown, the updated order data is input into a preset symmetric encryption algorithm, the updated order data is encrypted using the preset symmetric encryption algorithm and the symmetric encryption algorithm key, and the encrypted data is output, and the encrypted data is called encrypted ciphertext.
[0069] Step 302: Use the public key of the second order system to asymmetrically encrypt the symmetric encryption algorithm key to obtain an encrypted key ciphertext.
[0070] The public key of the second order system is the public key of the recipient system, which can be pre-configured.
[0071] Specifically, in this embodiment, Figure 6 As shown, a pre-configured symmetric encryption algorithm key is obtained, the symmetric encryption algorithm key and the public key of the second order system are input into the asymmetric encryption algorithm, the symmetric encryption algorithm key is encrypted using the asymmetric encryption algorithm and the public key of the second order system, and the encrypted key ciphertext is output.
[0072] Step 303, using the first hash function to process the updated order data to generate a corresponding digital summary before encryption, and using the private key corresponding to the first order system to asymmetrically encrypt the digital summary before encryption to obtain the encrypted digital summary.
[0073] The private key corresponding to the first order system is the private key of the sender system, which can be pre-configured.
[0074] In this embodiment, the first hash function is a function for performing hash processing on the updated order data.
[0075] Specifically, in this embodiment, Figure 6As shown, the updated order data is input into the first hash function, and the updated order data is hashed using the first hash function to generate and output a digital summary. The digital summary is the digital summary before encryption. The private key corresponding to the first order system is obtained, and the private key corresponding to the first order system and the digital summary before encryption are input into the asymmetric encryption algorithm, and the digital summary before encryption is encrypted using the asymmetric encryption algorithm to generate and output the encrypted digital summary.
[0076] Step 304, determining the encrypted ciphertext, the encrypted key ciphertext and the encrypted digital summary as the signed order data.
[0077] In this embodiment, the encrypted ciphertext, the encrypted key ciphertext and the encrypted digital summary may be concatenated in a preset order and jointly determined as the signed order data.
[0078] The order data processing method provided in the present embodiment encrypts the updated order data to obtain an encrypted ciphertext when digitally signing the updated order data to obtain the signed order data; asymmetric encryption is performed on the symmetric encryption algorithm key using the public key of the second order system to obtain an encrypted key ciphertext; the updated order data is processed using the first hash function to generate a corresponding digital summary before encryption, and the digital summary before encryption is asymmetric encrypted using the private key corresponding to the first order system to obtain an encrypted digital summary; the encrypted ciphertext, the encrypted key ciphertext and the encrypted digital summary are determined as the signed order data. Since the updated order data, the symmetric encryption algorithm key and the digital summary are all encrypted and used together as the signed order data, it can further ensure that the updated order data is not tampered with during transmission, thereby further improving the security of the updated order data during transmission.
[0079] Embodiment 3
[0080] Figure 7 is a flow chart of an order data processing method provided by another embodiment of the present invention, such as Figure 7 As shown, the order data processing method provided in this embodiment further includes other steps based on the order data processing method provided in any of the above embodiments. Then the order data processing method provided in this embodiment further includes the following steps:
[0081] Step 401, reading at least one first order data obtained from the first order system in the second order system according to a preset time period.
[0082] In this embodiment, the preset time period can be pre-configured, such as every 15 minutes as a time period, or every 1 hour as a time period, etc. In this embodiment, the value of the preset time period is not limited.
[0083] Specifically, in this embodiment, after the second order system receives the updated order data pushed by the first order system and synchronously updates the updated order data, the updated order data can be marked to determine that the updated order data is the order data pushed by the first order system.
[0084] Therefore, in this embodiment, the server of the first order system accesses the database of the second order system according to a preset time period, and obtains order data marked as obtained from the first order system from the database of the second order system. The order data obtained from the first order system is the first order data.
[0085] The first order data at least includes: a number of the first order data and an order status of the first order data. The number of the first order data is the first order number, and the order status of the first order data is the first order status.
[0086] Step 402, each first order data is placed in a key-value pair of the second hash function; Key stores the first order number corresponding to the first order data, and Value stores the first order status corresponding to the first order data.
[0087] Among them, the function that stores the key-value pairs corresponding to the first order data is the second hash function.
[0088] Specifically, in this embodiment, the order number and order status in each first order data are extracted, and the order number in each first order data is stored in the Key in the second hash function key-value pair, and the order status in each first order data is stored in the Value in the second hash function key-value pair. And the order number and order status in the same first order data are stored in a key-value pair of the second hash function.
[0089] Step 403, obtaining second order data corresponding to a preset time period from the first order system.
[0090] In this embodiment, in the database of the first order system server, order data of operations such as creation and modification within a preset time period is obtained, and the order data corresponding to the preset time period obtained from its own system is the second order data.
[0091] Step 404: verify the first order data and the second order data according to the second order and the key value of the second hash function.
[0092] As an optional implementation, in this embodiment, step 404 includes the following steps:
[0093] Step 4041, obtain the second order number and the second order status in the second order data.
[0094] In this embodiment, the second order data at least includes an order number and an order status. The order code in the second order data is the second order number. The order status in the second order data is the second order status.
[0095] Specifically, after obtaining the second order data corresponding to the preset time period in the first order system, the second order data is parsed to obtain the second order number and the second order status in the second order data.
[0096] Step 4042, traverse the Key in the key-value pair of the second hash function through each second order number to determine whether there is any missing order data in the first order data and the second order data. If it is determined that there is any missing order data, the missing order data is supplemented in the corresponding order system.
[0097] In this embodiment, each second order number is compared with the Key in the key-value pair of the second hash function to determine whether each second order number exists in the Key in the key-value pair of the second hash function, and whether the Key in the key-value pair of the second hash function exists in each second order number. If it is determined that a certain second order number does not exist in the Key in the key-value pair of the second hash function, it means that the second order system has missed the order data pushed from the first order system, and the missed order data will be supplemented in the database of the second order system. If it is determined that a certain key in the key-value pair of the second hash function does not exist in each second order number, it means that when the first order system pushed the updated order data to the second order system, it did not update the updated order data itself, and missed it, and the missed order data will be supplemented in the database of the first order system.
[0098] Step 4043, traverse the Value in the key-value pair of the second hash function according to each second order status to determine whether the order status in the first order data and the second order data is consistent. If it is determined that the order status is inconsistent, modify the corresponding order status in the corresponding order system based on the most recently updated order data.
[0099] In this embodiment, after obtaining the second order status in the second order data, each second order status is compared with the Value in the key-value pair of the second hash function to determine whether each second order status is consistent with the corresponding Value. If it is determined that a second order status is inconsistent with the corresponding Value, the update time corresponding to the inconsistent second order data and the corresponding first order data is obtained, and it is determined whether the most recently updated order data is the first order data or the second order data based on the update time. If it is the first order data, the second order status of the corresponding second order data is modified in the first order system based on the first order data. If it is the second order data, the first order status of the corresponding first order data in the second order system is modified based on the second order data.
[0100] Step 405, backing up the original order data with missing order data and inconsistent order status.
[0101] In this embodiment, the missing order data in step 4042 and the original order data with inconsistent order status in step 4043 are obtained, and the missing order data and the original order data with inconsistent order status can be backed up in the first order system and the second order system simultaneously. When there is a problem with the goods purchased by the user, the flow process of the goods can be sorted out according to the backed-up order data, and the responsibility can be effectively investigated.
[0102] The order data processing method provided in this embodiment reads at least one first order data obtained from the first order system in the second order system according to a preset time period; each first order data is placed in the key-value pair of the second hash function; the Key stores the first order number corresponding to the first order data, and the Value stores the first order status corresponding to the first order data; obtains the second order data corresponding to the preset time period from the first order system; and verifies the first order data and the second order data according to the key value pair of the second order and the second hash function. Since when verifying the order data, all order data occurring in the preset time period can be verified at one time according to the key-value pair in the second hash function, it can effectively solve the problem of low verification efficiency when verifying whether there is missing order data and whether there is inconsistency in order status, and effectively improve the verification efficiency of order data.
[0103] Embodiment 4
[0104] Figure 8 is a flow chart of an order data processing method provided by another embodiment of the present invention, such as Figure 8 As shown, the execution subject of this embodiment is an order data processing device, and the order data processing device is located in the server of the second order system. Then the order data processing method provided by this embodiment includes the following steps:
[0105] Step 501, receiving the signed order data sent by the first order system; the signed order data is obtained after the first order system detects an update of the order data and performs digital signature processing on the updated order data.
[0106] In this embodiment, the server of the second order system communicates with the server of the first order system. When the server of the first order system detects that an order update has occurred, the updated order information is digitally signed and sent to the server of the second order system, so that the server of the second order system receives the signed order data.
[0107] Step 502: Verify the signed order data, and synchronize the updated order data after the verification is passed.
[0108] In this embodiment, a preset decryption algorithm and hash function are used to verify the signed order data to obtain the result of the verification. If the result of the verification is determined to be passed, the updated order data is synchronously updated in the server of the second order system according to the update type of the updated order data.
[0109] Step 503: Send the push result to the first order system.
[0110] In this embodiment, after the second order system performs synchronous update on the updated order data, a push result is generated. If the synchronous update result is a successful update result, the generated push result is a successful update push result. The successful update push result is pushed to the first order system. If the synchronous update result is a failed update result, the generated push result is a failed update push result. The failed update push result is pushed to the first order system.
[0111] The order data processing method provided in this embodiment receives the signed order data sent by the first order system; the signed order data is obtained after the first order system detects the update of the order data and performs digital signature processing on the updated order data; the signed order data is verified, and the updated order data is synchronously updated after the verification is passed; and the push result is sent to the first order system. Since the online order system and the offline order system communicate directly and synchronize the online order data and the offline order, there is no need for the participation of the intermediate business layer, which reduces the development workload of the intermediate business layer. And before the first order system pushes the updated order data to the second order system, it digitally signs the updated order data to obtain the signed order data, so the security of the order data is effectively guaranteed.
[0112] Embodiment 5
[0113] Fig. 9 FIG. 1 is a flow chart of an order data processing method provided by another embodiment of the present invention. Fig. 9 As shown, the order data processing method provided in this embodiment is based on the order data processing method provided in Example 4, and further refines the signature verification process of the signed order data in step 502. The order data processing method step 502 provided in this embodiment includes the following steps:
[0114] Step 601, use the private key of the second order system to decrypt the encrypted key ciphertext to obtain the symmetric encryption algorithm key.
[0115] Among them, the private key of the second order system is the private key of the recipient system, and the private key can be pre-configured.
[0116] In step 302 of the second embodiment, since the public key of the second order system is used to perform asymmetric encryption processing on the symmetric encryption algorithm key to obtain the encrypted key ciphertext, the private key of the second order system and the asymmetric decryption algorithm need to be used in the server of the second order system to decrypt the encrypted key ciphertext to obtain the symmetric encryption algorithm key after decryption.
[0117] Among them, the asymmetric decryption algorithm and the asymmetric encryption algorithm are matched.
[0118] Specifically, Fig.10 As shown, obtain the pre-configured private key of the second order system, input the private key of the second order system and the encrypted key ciphertext into the asymmetric decryption algorithm, use the asymmetric decryption algorithm and the private key of the second order system to decrypt the encrypted key ciphertext, and output the decrypted symmetric encryption algorithm key.
[0119] Step 602: Decrypt the encrypted ciphertext using the symmetric encryption algorithm key and the symmetric decryption algorithm to obtain decrypted order data.
[0120] In this embodiment, since in step 302 of implementation two, the encrypted ciphertext is obtained by encrypting the updated order data using a preset symmetric encryption algorithm and a symmetric encryption algorithm key, in step 602, the encrypted ciphertext is decrypted using the symmetric encryption algorithm key and the symmetric decryption algorithm obtained in step 601 to obtain the decrypted order data.
[0121] Among them, the symmetric decryption algorithm matches the symmetric encryption algorithm.
[0122] Specifically, in this embodiment, Fig.10As shown, the symmetric encryption algorithm key is obtained, and the symmetric encryption algorithm key and the encrypted ciphertext are input into the symmetric decryption algorithm. The encrypted ciphertext is decrypted using the symmetric decryption algorithm and the symmetric encryption algorithm key, and the decrypted order data is output.
[0123] Step 603: Decrypt the encrypted digital summary using an asymmetric decryption algorithm and a public key corresponding to the first order system to obtain a decrypted digital summary.
[0124] Among them, the public key corresponding to the first order system is the public key corresponding to the sender system and can be configured in advance.
[0125] In this embodiment, since in step 303 of embodiment 2, the encrypted digital summary is generated by asymmetric encryption of the digital summary before encryption using the private key corresponding to the first order system, in step 603 of this embodiment, an asymmetric decryption algorithm and the public key corresponding to the first order system are used to decrypt the encrypted digital summary to obtain the decrypted digital summary.
[0126] Among them, the asymmetric decryption algorithm and the asymmetric encryption algorithm are matched.
[0127] Specifically, in this embodiment, the public key of the first order system is obtained, the public key of the first order system and the encrypted digital summary are input into the asymmetric decryption algorithm, the encrypted digital summary is decrypted using the public key of the first order system and the asymmetric decryption algorithm, and the decrypted digital summary is output.
[0128] Step 604: Use the first hash function to process the decrypted order data to generate a digital summary for comparison.
[0129] In this embodiment, the decrypted order data is input into the first hash function, and the decrypted order data is hashed using the first hash function to generate and output a digital summary, which is called a compared digital summary.
[0130] Step 605: compare the compared digital summary with the decrypted digital summary, and determine whether the signature verification is passed based on the comparison result.
[0131] Specifically, in this embodiment, if the signed order data has not been tampered with during transmission to the server of the second order system, the digital summary for comparison should be consistent with the digital summary after decryption. If the signed order data has been tampered with during transmission to the server of the second order system, the digital summary for comparison should be inconsistent with the digital summary after decryption. Therefore, the comparison result is obtained. If it is determined that the comparison result is that the two digital signatures are consistent, it is determined that the signature verification has passed. On the contrary, if it is determined that the comparison result is that the two digital signatures are inconsistent, it is determined that the signature verification has not passed.
[0132] The order data processing method provided in this embodiment performs signature verification on the signed order data, decrypts the encrypted key ciphertext using the private key of the second order system to obtain the symmetric encryption algorithm key; decrypts the encrypted ciphertext using the symmetric encryption algorithm key and the symmetric decryption algorithm to obtain the decrypted order data; decrypts the encrypted digital summary using the asymmetric decryption algorithm and the public key corresponding to the first order system to obtain the decrypted digital summary; processes the decrypted order data using the first hash function to generate a comparison digital summary; compares the comparison digital summary with the decrypted digital summary, and determines whether the signature verification is passed according to the comparison result. Since the key ciphertext, the encrypted ciphertext and the encrypted digital summary are decrypted respectively during the signature verification, and the comparison digital summary is obtained after the decrypted order data is processed using the first hash function, when the comparison digital summary is compared with the decrypted digital summary, if any of the key ciphertext, the encrypted ciphertext and the encrypted digital summary is tampered with, it cannot be verified, so it can further ensure that the updated order data is not tampered with during the transmission process, and further improve the security of the updated order data during the transmission process.
[0133] Embodiment 6
[0134] Fig.11 is a flow chart of an order data processing method provided by another embodiment of the present invention, such as Fig.11 As shown, the order data processing method provided in this embodiment is based on the order data processing method provided in the fourth or fifth embodiment, the second order system is an online order system, and after the updated order data is synchronously updated after the signature verification is passed, it also includes the following steps:
[0135] Step 701, monitoring whether the client of the second order system where order data synchronization is updated is online.
[0136] In this embodiment, the online order system obtains the user whose order data has been synchronously updated, and monitors whether the online order system of the user is online. When monitoring whether the online order system of the user is online, it is determined whether the client of the online order system of the user has interacted with the server in the recent preset time period. If it is determined that there has been an interaction with the server, it is determined that the online order system of the user is online. On the contrary, if it is determined that there has been no interaction with the server, it is determined that the online order system of the user is offline.
[0137] Step 702: If the online state is determined, the updated order data is pushed to the client.
[0138] In this embodiment, if it is determined to be in an online state, the updated order data is immediately pushed to the client via WebSocket to remind the user that the order data has been successfully updated, such as the order has been successfully placed, the order status has been successfully modified, etc.
[0139] Step 703, if it is determined to be in an offline state, the updated order data is cached, and the client state is monitored using a thread. If it is monitored to be in an online state, the updated order data is pushed to the client and the cache corresponding to the updated order data is deleted.
[0140] In this embodiment, if it is determined to be in an offline state, Redis is used to cache the updated order data. A thread in the thread pool is used to monitor the status of the user's client in real time. If it is detected to be in an online state, the updated order data is immediately pushed to the client through WebSocket to remind the user that the order data has been successfully updated. The updated order data in the Redis cache is deleted.
[0141] The order data processing method provided in this embodiment monitors whether the client whose order data is synchronously updated in the second order system is online; if it is determined to be online, the updated order data is pushed to the client; if it is determined to be offline, the updated order data is cached, and the thread is used to monitor the client status. If it is monitored to be online, the updated order data is pushed to the client and the cache corresponding to the updated order data is deleted. Since the user's client is online, the updated order data is received in the first place, which improves the user's management experience of online and offline order data.
[0142] It should be noted that in this embodiment, the user can also manage the order data in the second order system and the order data in the first order system in a unified manner through the client of the first order system. Similarly, the user can also manage the order data in the first order system and the primary order data in the second order system in a unified manner through the client of the second order system. This further improves the user's management experience of online and offline order data.
[0143] Embodiment 7
[0144] Fig.12 Schematic diagram of the structure of an order system server for implementing the order data processing method of an embodiment of the present invention, such as Fig.12 As shown, the server 80 of the order system provided in this embodiment includes: at least one processor 82, a memory 81 and a transceiver 83.
[0145] The processor 82, the memory 81 and the transceiver 83 are interconnected.
[0146] The memory 81 stores computer-executable instructions. The transceiver 83 is used for sending and receiving data.
[0147] At least one processor 82 executes the computer-executable instructions stored in the memory, so that at least one processor executes the method provided in any one of Embodiments 1 to 6.
[0148] Embodiment 8
[0149] Fig.13 is a block diagram of a server of an order system for implementing the order data processing method of an embodiment of the present invention, such as Fig.13 As shown, the server of the order system can be a computer, a blade server, a slice server or a server cluster, etc.
[0150] The server 900 of the order system may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , an input / output (I / O) interface 912 , a sensor component 914 , and a communication component 916 .
[0151] The processing component 902 generally controls the overall operation of the server 900 of the order system, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components.
[0152] The memory 904 is configured to store various types of data to support the operation of the server 900 of the order system. Examples of such data include instructions for any application or method operating on the server 900 of the order system, contact data, phone book data, messages, pictures, videos, etc. The memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0153] The power supply component 906 provides power to various components of the order system's server 900. The power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the order system's server 900.
[0154] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0155] The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the order system server 900. For example, the sensor assembly 914 can detect the open / closed state of the order system server 900, the relative positioning of components, such as the display and keypad of the order system server 900, the sensor assembly 914 can also detect the position change of the order system server 900 or a component of the order system server 900, the presence or absence of user contact with the order system server 900, the orientation or acceleration / deceleration of the order system server 900 and the temperature change of the order system server 900. The sensor assembly 914 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0156] The communication component 916 is configured to facilitate wired or wireless communication between the server 900 and other devices of the order system. The server 900 of the order system can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0157] In an exemplary embodiment, the server 900 of the order system can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above methods.
[0158] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, and the instructions can be executed by a processor 920 of a server 900 of the order system to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0159] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the server of the order system, enables the server of the order system to execute the method provided by any one of the above-mentioned embodiments 1 to 6.
[0160] In an exemplary embodiment, a computer program product is also provided, including a computer program, where a processor executes the method provided by any one of the above-mentioned embodiments 1 to 6.
[0161] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be regarded as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0162] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for processing order data, characterized in that: The method is applied in a server of a first order system, and the method comprises: Monitor whether order data is updated; If an update of the order data is detected, the updated order data will be digitally signed to obtain the signed order data; Pushing the signed order data to a second order system so that the second order system verifies the signed order data and synchronously updates the updated order data after the verification, wherein the first order system is one of the online order system and the offline order system, and the second order system is the other of the online order system and the offline order system; Receive the push result sent by the second order system; The step of digitally signing the updated order data to obtain the signed order data includes: Encrypting the updated order data to obtain encrypted ciphertext; Asymmetric encryption is performed on the symmetric encryption algorithm key using the public key of the second order system to obtain an encrypted key ciphertext; The updated order data is processed using a first hash function to generate a corresponding digital summary before encryption, and the digital summary before encryption is asymmetrically encrypted using a private key corresponding to the first order system to obtain an encrypted digital summary; The encrypted ciphertext, the encrypted key ciphertext and the encrypted digital summary are determined as the signed order data.
2. The method according to claim 1, characterized in that: The order data includes: order number and order status; The method further comprises: Reading at least one first order data acquired from the first order system in the second order system according to a preset time period; Each first order data is placed in a key-value pair of the second hash function; the Key stores the first order number corresponding to the first order data, and the Value stores the first order status corresponding to the first order data; Acquire second order data corresponding to a preset time period from the first order system; The first order data and the second order data are verified according to the second order and the key value of the second hash function.
3. The method according to claim 2, characterized in that The verifying the first order data and the second order data according to the second order and the key value of the second Hash function includes: Obtain the second order number and the second order status in the second order data; Traversing the Key in the key-value pair of the second hash function through each of the second order numbers to determine whether missing order data occurs in the first order data and the second order data; if it is determined that missing order data occurs, supplementing the missing order data in the corresponding order system; The Value in the key-value pair of the second hash function is traversed according to each second order status to determine whether the order status in the first order data and the second order data is consistent. If it is determined that the order status is inconsistent, the corresponding order status is modified in the corresponding order system based on the most recently updated order data.
4. The method according to claim 3, characterized in that Also includes: The missing order data and the original order data with inconsistent order status are backed up.
5. A method for processing order data, characterized in that: The method is applied to a server of a second order system, and the method comprises: Receiving the signed order data sent by the first order system; the signed order data is obtained after the first order system detects an update of the order data and performs digital signature processing on the updated order data; Performing signature verification on the signed order data, and synchronously updating the updated order data after the signature verification is passed; Send push results to the first order system; The signature verification process of the signed order data includes: Decrypting the encrypted key ciphertext using the private key of the second order system to obtain the symmetric encryption algorithm key; Decrypting the encrypted ciphertext using the symmetric encryption algorithm key and the symmetric decryption algorithm to obtain decrypted order data; Decrypting the encrypted digital summary using an asymmetric decryption algorithm and a public key corresponding to the first order system to obtain a decrypted digital summary; Processing the decrypted order data using a first hash function to generate a digital summary for comparison; The compared digital summary is compared with the decrypted digital summary, and whether the signature verification passes is determined based on the comparison result.
6. The method according to claim 5, characterized in that The second order system is an online order system, and after the updated order data is synchronously updated after the signature verification is passed, it also includes: Monitor whether the client where the order data is synchronously updated in the second order system is online; If it is determined to be in an online state, the updated order data is pushed to the client; If it is determined to be in an offline state, the updated order data is cached, and a thread is used to monitor the status of the client. If it is monitored to be in an online state, the updated order data is pushed to the client and the cache corresponding to the updated order data is deleted.
7. A server for an order system, characterized in that: include: at least one processor, memory and transceiver; The processor, the memory and the transceiver circuit are interconnected; The memory stores computer-executable instructions; the transceiver is used to send and receive data; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 4 or any one of claims 5 to 6.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 4 or any one of claims 5 to 6 when executed by a processor.
9. A computer program product, comprising 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 6 is implemented.
Citation Information
Patent Citations
Method and device for realizing data order synchronization
CN110716981A
Method and device for pushing order information, medium and program product
CN113014670A