CN111177121A - Order data feedback method and device, computer equipment and storage medium - Google Patents
Order data feedback method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN111177121A CN111177121A CN201911369754.3A CN201911369754A CN111177121A CN 111177121 A CN111177121 A CN 111177121A CN 201911369754 A CN201911369754 A CN 201911369754A CN 111177121 A CN111177121 A CN 111177121A
- Authority
- CN
- China
- Prior art keywords
- feedback data
- data
- version number
- feedback
- order
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 230000008859 change Effects 0.000 claims abstract description 26
- 238000004590 computer program Methods 0.000 claims description 15
- 230000005540 biological transmission Effects 0.000 abstract description 17
- 239000002699 waste material Substances 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 238000004364 calculation method Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000004422 calculation algorithm Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 235000014510 cooky Nutrition 0.000 description 2
- 125000004122 cyclic group Chemical group 0.000 description 2
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 239000002253 acid Substances 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/219—Managing data history or versioning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses an order data feedback method, an order data feedback device, computer equipment and a readable storage medium. The method comprises the steps of obtaining change information of a user order, updating feedback data of the user order in a preset database and a feedback data version number associated with the feedback data according to the change information, taking the updated feedback data as target feedback data, and taking the updated feedback data version number as a target version number; sending a first updating instruction, target feedback data and a target version number to a client; if an order query request of the user order is received, acquiring the index version number from the order query request; and if the index version number is consistent with the target version number, sending a second updating instruction to the client. By adopting the method, the occurrence of network transmission resource waste caused by repeated data request of the user is avoided.
Description
Technical Field
The present application relates to the field of data processing technologies, and in particular, to an order data feedback method, an order data feedback device, a computer device, and a storage medium.
Background
In the mobile internet era, the number of mobile clients is huge, so that the data interaction frequency between the clients and the server is dense, and the requirement on the performance of data transmission is higher.
Taking the query application as an example, even the same user may generate multiple or nearly repeated data query requests due to different specific use cases. For example, a user purchases a product on an e-commerce website, and orders are repeatedly placed and cancelled because of hesitation; and the user logs in on a plurality of intelligent terminals, operates the same order and the like. In a large application system, network transmission resources are wasted due to repeated data requests of a large number of users, meanwhile, computing resources of a server are occupied, performance consumption is high, and system response is slow.
Disclosure of Invention
The embodiment of the invention provides a user order data feedback method, a user order data feedback device, computer equipment and a storage medium, and aims to solve the technical problem of network transmission resource waste caused by repeated data requests of a large number of users in the prior art.
A user order data feedback method comprises the following steps:
acquiring change information of a user order, updating feedback data of the user order in a preset database and a feedback data version number associated with the feedback data according to the change information, taking the updated feedback data as target feedback data, and taking the updated feedback data version number as a target version number;
sending a first updating instruction, the target feedback data and the target version number to a client, wherein the first updating instruction is used for instructing the client to update result feedback data in a local database according to the target feedback data and instructing the client to update an index version number in the local database according to the target version number;
if an order query request of the user order is received, acquiring the index version number from the order query request;
and if the index version number is consistent with the target version number, sending a second updating instruction to the client, wherein the second updating instruction is used for indicating the client to use the result feedback data in the local database as a data query result.
A user order data feedback device comprising:
the order data updating module is used for acquiring change information of a user order, updating feedback data of the user order in a preset database and a feedback data version number associated with the feedback data according to the change information, taking the updated feedback data as target feedback data, and taking the updated feedback data version number as a target version number;
a data update indicating module, configured to send a first update instruction, the target feedback data, and the target version number to a client, where the first update instruction is used to instruct the client to update result feedback data in a local database according to the target feedback data, and is also used to instruct the client to update an index version number in the local database according to the target version number;
the query request receiving module is used for acquiring the index version number from the order query request if the order query request of the user order is received;
and the first version comparison module is used for sending a second updating instruction to the client if the index version number is consistent with the target version number, wherein the second updating instruction is used for indicating the client to use the result feedback data in the local database as a data query result.
A computer device comprising a memory and a processor, and a computer program stored in said memory and executable on said processor, said processor implementing the steps of the above order data feedback method when executing said computer program.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above order data feedback method.
According to the user order data feedback method, the device, the computer equipment and the readable storage medium, by judging the consistency of the feedback data version number in the local database and the feedback data version number in the preset database, when the feedback data version number is consistent, only a result feedback data indicating the local client needs to be sent to the client as an updating instruction of a data query result, and the sending of full feedback data is not required to be carried out for each query request of the client, so that the waste of network transmission resources caused by repeated data requests of a user is avoided, and the occupancy rate of the network transmission resources is effectively reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a diagram illustrating an exemplary implementation of an order data feedback method;
FIG. 2 is a flow diagram illustrating a method for feedback of order data according to one embodiment;
FIG. 3 is a flow chart illustrating a method for feeding back order data according to another embodiment;
FIG. 4 is a flowchart illustrating step 304 of the order data feedback method according to one embodiment;
FIG. 5 is a flow chart illustrating step 304 of the order data feedback method according to another embodiment;
FIG. 6 is a flow chart illustrating a method for feeding back order data according to another embodiment;
FIG. 7 is another flow diagram illustrating an exemplary method for feeding back order data;
FIG. 8 is a schematic diagram of an order data query device in one embodiment;
FIG. 9 is a diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The order data feedback method provided by the embodiment of the invention can be applied to the application environment shown in fig. 1. Wherein, the terminal 102 communicates with the server 104 through the network. The server 104 acquires the user order change information, updates feedback data of the user order pre-stored in a preset database and a feedback data version number associated with the feedback data according to the user order change information, and respectively takes the feedback data and the feedback data as target feedback data and a target version number; when the server 104 receives a data query request of a user order sent by the terminal 102, the data query request is analyzed, an index version number of the user order included in the data query request is extracted, the extracted index version number is compared with a target version number in a preset database in a consistent manner, and if the index version number is consistent with the target version number, a data update instruction which takes result feedback data in a local database as a data query result is sent to the terminal 102. Therefore, the purpose of sending the full feedback data is achieved without making a query request to the terminal 102 every time. The terminal 102 and the server 104 are connected through a network, the network may be a wired network or a wireless network, the terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, an order data feedback method is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps:
The user order refers to a data request initiated by a user to a server through a client, and the application scenes of the user order include but are not limited to reservation of air tickets, hotels, online shopping, reservation of services and the like.
The user order includes, but is not limited to, a user identification, an order type, order detail information, and the like. The user identity identification can be an id number for identifying the user identity and is used for uniquely distinguishing a registered user; the order type can be used for ordering operation, consulting operation and the like; the order detail information may be different according to different application scenarios, such as a list of items that the user needs to purchase, including but not limited to the name, model, and the like of the item.
The change information of the user order refers to the change information of the attributes of the user order such as the payment state, the logistics transportation state and the like; the preset database is arranged on a database which is arranged on the server and used for storing user order data; the feedback data is a detailed information record of the user order, wherein the detailed information record can comprise information related to the user order, such as the identity of the user, account information, the order type, the order state, the payment state, the order creation time, the order ending time and the like, and when the user order changes, the user order is updated, and the updated feedback data is used as target feedback data; the feedback data version number is the version number of the feedback data generated according to the feedback data, the feedback data version number is updated along with the feedback data updated due to the change information of the user order, and the updated feedback data version number is used as a target version number. The target feedback data is a record of the user order in the current latest state, and the target version number is the version number of the latest feedback data.
Specifically, the target version number is used for the server side to record the feedback data state of the user order in different periods. The server establishes an index for each user order, the feedback data and the target version number of the user order are in one-to-one correspondence and stored as a data record, and a user can retrieve, inquire and the like the user order by taking the target version number as the index.
And 204, sending a first updating instruction, target feedback data and a target version number to the client, wherein the first updating instruction is used for instructing the client to update the result feedback data in the local database according to the target feedback data, and is also used for instructing the client to update the index version number in the local database according to the target version number.
Specifically, when a user order changes, the server sends target feedback data and a target version number which are updated according to change information of the user order in a preset database to the client, and sends a first updating instruction to the client; after receiving the first instruction, the client updates result feedback data in the local database according to the received target feedback data; the result feedback data can be target feedback data in a preset database sent by a received server side, or can be first received feedback data generated according to the user order; the index version number is the version number of the feedback data in the local database; the first update instruction may be specifically a status flag bit, and occupies very little transmission resources.
In step 206, if an order query request of a user order is received, an index version number is obtained from the order query request.
The order query request is a query request sent by the client to the server for querying feedback data corresponding to the user order, and may be a request for querying an order placing time of the user, a request for a current credit of the user, or a request for a current logistics state of the user order, or the like.
When the client sends the data query request to the server, the client agrees with each other on a data interaction protocol, namely, other required information and the index version number are used as additional information in the order query request and are sent to the server together.
For example, if the user queries a shopping list, when the client submits a query form to the server, the client sends an index version number stored locally at the client as additional information to the server together with an order query request. An order query request submitted in the form of an HTTP form may be expressed as: "http:// tst.com/order? The 'version c', wherein the index version number 'version c' will be submitted to the server along with the variable 'version'. It is understood that the server may obtain the index version number according to the variable version.
And step 208, if the index version number is consistent with the target version number, sending a second updating instruction to the client, wherein the second updating instruction is used for indicating the client to use result feedback data in the local database as a data query result.
Specifically, after the index version number is obtained from the order query request, a feedback data version number identical to the search version number is searched in a preset database according to the index version number, target feedback data corresponding to the searched feedback data version number is obtained, and then consistency comparison is performed between the index version number and the target version number corresponding to the obtained target feedback data.
The second updating instruction for obtaining the result feedback data in the local database as the query result means that the client uses the result query data in the local database as the query result and does not need to repeatedly obtain the feedback data from the server; the second update instruction may be specifically a status flag bit, and occupies a very small transmission resource.
According to the data interaction protocol agreed between the client and the server, when the client receives a second updating instruction for acquiring local data, the client reads feedback data from a local file or a local database to obtain a result of a data query request, so that the data transmission amount between the client and the server is reduced, and the computing resources of the server are saved.
Further, the above steps 202-208 may be performed in an asynchronous computing manner. Specifically, a thread pool is preset, which includes a group of active threads, and the size of the thread pool may be allocated according to the computing resources of the server, for example, if the number of cores of the server CPU is N, the size of the thread pool may be N + 1; if the operating environment of the server is a Java operating environment, the steps originally completed by one thread are divided into a plurality of thread operations, each thread processes one step independently, the original serial execution sequence of a single thread is changed into a parallel execution sequence processed by a plurality of threads in a cross mode, and the concurrent processing of the plurality of threads is realized, so that the waiting time of the client is reduced, and the response speed of the system is improved.
According to the order data feedback method, the consistency between the feedback data version number in the local database and the feedback data version number in the preset database is judged, when the feedback data version number in the local database and the feedback data version number in the preset database are consistent, only a data updating instruction which indicates the local result feedback data of the client side as a data query result needs to be sent to the client side, and the fact that the whole amount of feedback data is sent to each query request of the client side is not needed, the situation that network transmission resources are wasted when a user repeatedly requests data is greatly avoided, and the occupancy rate of the network transmission resources is effectively reduced.
In one embodiment, as shown in fig. 3, after step 206, the method further includes:
Specifically, the index version number is inconsistent with the target version number, which represents that the version number of the client is expired, and the server automatically obtains update feedback data from the preset database according to the information that the version number is inconsistent, where the update feedback data is a data record of the user order associated with the target version number.
If the index version number is inconsistent with the target version number, the index version number is proved to be expired or damaged, and although the index version number on the client is also the feedback version number of the feedback data of the same user order, various factors may cause the index version number to be inconsistent with the target version number. From the application point of view, taking the transaction as an example: when the transaction is completed, the version numbers of the client and the server are definitely consistent; however, in the transaction, before the user order is finally ended, there are a plurality of states in the middle, the client can send out a plurality of data requests in the transaction, at this time, the client has only one state or version number, and the server records a plurality of states or version numbers.
There are generally the following scenarios when the index version number is inconsistent with the target version number:
1) a user uses multi-machine operation, namely different clients are used for respectively carrying out order placing operation and query operation;
2) after the user uninstalls the APP on the client, reinstalling the APP;
3) the user replaces the client, and if the user uses a new mobile phone to operate;
4) and other reasons cause the file storing the feedback data version number on the client to be lost or damaged, such as mistaken deletion operation of a user and the like.
Preferably, the index version number and the target version number may be compared for consistency by character comparison to determine whether the two are consistent.
And step 304, sending a data updating instruction, updating feedback data and a target version number to the client, wherein the data updating instruction is used for instructing the client to update the result feedback data in the local database according to the updating feedback data, and taking the updated result feedback data as a data query result.
The data updating instruction can be a status flag bit, and the occupied transmission resource is extremely small; the update feedback data is data for updating the result feedback data in the local database generated according to the updated target feedback data.
And further, the data updating instruction is also used for instructing the client to use the target version number as a new index version number. Specifically, since the order data query may be a cyclic process, after the feedback data corresponding to the user order is queried through the index of the old index version number, if the version numbers are not consistent, the version number of the server is used as the standard, and the server is sent to the client as the new index version number for the next order query.
According to the embodiment, by judging the consistency of the version number of the feedback data in the local database and the version number of the feedback data in the preset database, only when the version number of the feedback data in the local database is inconsistent with the version number of the feedback data in the preset database, the update feedback data, the target version number and the result feedback data used for instructing the client to update the local result feedback data according to the update feedback data are sent to the client, the updated result feedback data are used as a data update instruction of a data query result, a response to each query request of the client is not needed to update the feedback data, and the occurrence of network transmission resource waste caused by repeated data requests of a user is greatly avoided.
In one embodiment, as shown in fig. 4, in step 304, obtaining the update feedback data specifically includes the following steps:
The integrity state value of the result feedback data reflects the integrity of the result feedback data in the local database of the client, and is a numerical parameter which is simultaneously transmitted to the server by the client along with the first order query request. For example, if the number 1 represents complete, it indicates that the feedback data stored in the local database of the client is not modified or missing; the number 0 represents incomplete, which means that the feedback data stored in the client local database is missing or modified.
In step 404, if the integrity status value is not the same as the preset integrity status value in the preset database, the target feedback data is used as the updated feedback data.
Specifically, after the version number comparison, if the integrity state value obtained by the server is different from the preset integrity state value in the preset database, it indicates that the result feedback data is incomplete, and the target feedback data is used as the update feedback data. It should be noted that, in the local database of the client, the incomplete result feedback data is generally caused by the situations of user local deletion by mistake, client file damage, and the like.
In this embodiment, when the version number of the feedback data in the local database is inconsistent with the version number of the feedback data in the preset database, determining the type of the update feedback data sent to the client by judging whether the feedback data in the local database is complete, and if the integrity state value of the feedback data in the local database represents incomplete, sending the target feedback data as the update feedback data to the client, instructing the client to update the result feedback data in the local database according to the update feedback data, and taking the updated result feedback data as an order query result; by the method, original data in the local database can be repaired/updated, offline checking by a user is facilitated, waste of network transmission resources caused by the fact that full feedback data is required to be fed back for various data requests of the user can be avoided, and the risk of network congestion is reduced.
In one embodiment, as shown in fig. 5, step 304 may further include:
The specific implementation process of this step is the same as that of step 402, and is not described here again to avoid repetition.
In step 504, if the integrity status value is the same as the preset integrity status value in the preset database, the incremental feedback data between the index version number and the target version number is used as the update feedback data.
The incremental feedback data is a change part of feedback data in a preset database from the index version number in the local database to the target version number. For example, if a record of the feedback data is newly added or modified on the basis of the preset database, the preset database may export the modified or "added" portion, or output the modified or "added" portion in the form of a file or a compressed package, through the relevant tool.
Specifically, after the comparison of the version numbers, if the integrity state value obtained by the server is the same as the preset integrity state value in the preset database, it indicates that the result feedback data is complete, the difference between the feedback data version number in the preset database and the target version number may be calculated to obtain the incremental feedback data, and the incremental feedback data obtained by calculation is used as the update feedback data.
In this embodiment, when the feedback data version number in the local database is not consistent with the feedback data version number in the preset database, the type of the updated feedback data sent to the client is determined by judging whether the feedback data in the local database is complete, and if the integrity state value of the feedback data in the local database represents complete, a changed part of the feedback data in the preset database after the index version number in the local database is used as incremental feedback data and sent to the client, and the client is instructed to update the result feedback data in the local database according to the incremental feedback data, and use the updated result feedback data as an order query result. Only the change part of the feedback data needs to be sent to the client, and the full amount of feedback data does not need to be responded to each inquiry request of the client, so that the waste of network transmission resources caused by repeated data requests of a user is greatly avoided.
In one embodiment, as shown in fig. 6, before step 402 or step 502, the integrity status value of the obtained result feedback data may be obtained by performing a check calculation on the result feedback data in the local database, which is detailed as follows:
in step 608, if the initial check code is the same as the check code to be verified, an integrity status value is generated, and the integrity status value is set to 1.
The CRC is a check code having the capability of error detection and error correction, where 0 represents that the feedback data local to the client is incomplete, and 1 represents that the feedback data local to the client is complete.
Through the embodiment, the integrity of the result feedback data can be detected, the integrity state value information of the result feedback data can be effectively obtained, preparation is made for comparison with the preset integrity state value of the preset data value, and the order data feedback efficiency is improved.
In one embodiment, as shown in fig. 7, before step 202, the method further includes:
Specifically, the user order reflects the user's requirements, and the server side, which provides corresponding services for the user's requirements, generates the original feedback data according to the user order.
The raw feedback data may be, specifically, one or more data tables, one or more data records, and the like, which is not limited herein. The raw feedback data may represent user status, order status, etc. For example, the raw feedback data may be a list of orders placed by the user; or, the logistics transportation state of the article, the state of whether the user pays or not, the receiving state and the like; the original feedback data are first feedback data generated according to the user order, and the original feedback data are different from the feedback data in that the original feedback data are feedback databases stored in preset databases before being updated for the first time according to the change information of the user order, and the original feedback data and the updated feedback data, namely the target feedback data are different in that the original feedback data and the updated feedback data are data records of the user order in real time under different time states.
Taking an e-commerce website as an example, when a user places an order through a client, a server acquires a data request of a user order, then generates order time according to system time of the current server, and forms an original feedback data table by using user identity identification, an id number of an article to be purchased, a current payment state, article logistics information and the like in the user order, and then sends the original feedback data table as original feedback data to the client, and the client stores the original feedback data in a local database as result feedback data.
Specifically, the feedback data version number is used to represent the state of the feedback data at different periods. The different periods refer to a situation that data is changed in the feedback data, for example, when the payment state and the logistics transportation state in the feedback data are changed, each change represents a period and corresponds to a version number, which is beneficial to tracking the data state, the changed original feedback data, the feedback data generated for the first time according to the user order is used as the original feedback data, and the version number of the original feedback data is used as the version number of the original feedback data.
The version number of the original feedback data can be specifically represented by a group of character strings, including numbers and English letters.
The preset version number generation mode includes but is not limited to the following three modes:
(1) generating according to the system time: that is, when the server receives the user order, the version number of the configuration information is generated according to the system time of the server, such as 20190313112259, which represents 22 minutes and 59 seconds at 11 o' clock of 3, 13 and 2019.
(2) Generating according to the message sequence of the received user order: that is, when the server receives the data request of the user order for the first time, a message list version number is generated, e.g. 2001, and when the data request of the user order is received again, the message list version number is incremented on the basis of the previous message list version number, e.g. 2002.
(3) Generating according to a preset algorithm: for example, MD5 calculations are performed on the raw feedback data by MD5 algorithm to get MD5 value as the order list version number. The md5, namely Message-Digest Algorithm, is a widely used cryptographic hash function that can generate a 128-bit (16-byte) hash value (hash value) to ensure the integrity and consistency of information transmission.
The version numbers obtained by the three version number generation modes can be used as original feedback data version numbers independently or integrally, the generation mode of the feedback data version numbers can be the same as that of the original feedback data version numbers, and the feedback data version numbers can also be updated according to incremental feedback data to obtain target version numbers. For example as shown in table 1:
user' s | Order list version number | Message list version number | Configuration information version number |
user1 | 748049e45d87b8c7 | 2001 | 201812290118200354 |
user2 | f766fa44e1ed0ff6 | 3001 | 201812290118223456 |
user3 | 568125ed6c3f6788 | 4001 | 201812290118234567 |
TABLE 1
The order list version number is a version number obtained by calculating MD5, the message list version number is a version number generated according to a message sequence of receiving user order data, and the configuration information version number is a version number generated according to system time. Taking the user "user 1" as an example, the feedback data version number corresponding to the feedback data of one of the user orders of the user "user 1" is: {748049e45d87b8c7, 2001, 201812290118200354 }.
It will be appreciated that the feedback data version number takes up much less space than the feedback data. For example, a feedback data version number coded in ASCII with 44 characters occupies 44 bytes, and feedback data in the form of a data table occupies more than several tens of KB.
When the client stores the feedback data and the feedback data version number, the client may adopt a form of a temporary file or a local database.
For example, if the client is a smart phone, the client may store the feedback data and the version number of the feedback data in the form of an SQLite database locally through a mobile phone APP.
Among them, SQLite, a lightweight database, is an ACID compliant relational database management system, which is contained in a relatively small C library. If the client is a PC, the client can store the cookie file in a browser. Cookie technology is one way for a server to maintain temporary data on a client.
In the embodiment, the original feedback data generated according to the request data of the user order submitted by the user for the first time and the original feedback data version number of the original feedback data are sent to the client, the client takes the original feedback data as the result feedback data according to the indication, and takes the original feedback data version number as the index version number and stores the index version number in the local database. When the online feedback data and the feedback data version number corresponding to the user order are not changed any more, the data in the local database can be used as a final result without requesting from a server, so that the data information of the user order can be checked in an offline state, the search time is reduced, and the system computing resources are saved.
It should be understood that although the various steps in the flowcharts of fig. 2-7 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-7 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 8, an order data feedback device is provided, and the order data feedback device corresponds to the order data feedback method in the above embodiment one to one. The order data feedback device includes an order data updating module 802, a data updating indication module 804, a query request receiving module 806 and a data version determining module 808, wherein:
the order data updating module 802 is configured to obtain change information of the user order, update feedback data of the user order in the preset database and a feedback data version number associated with the feedback data according to the change information, and use the updated feedback data as target feedback data and the updated feedback data version number as a target version number.
And a data update indicating module 804, configured to send a first update instruction, target feedback data, and a target version number to the client, where the first update instruction is used to indicate the client to update the result feedback data in the local database according to the target feedback data, and is also used to indicate the client to update the index version number in the local database according to the target version number.
The query request receiving module 806 is configured to, if an order query request of a user order is received, obtain an index version number from the order query request.
The first version comparing module 808 is configured to send a second update instruction to the client if the index version number is consistent with the target version number, where the second update instruction is used to instruct the client to use result feedback data in the local database as a data query result.
Further, the order data feedback device further comprises:
and a second version comparison module 810, configured to obtain the update feedback data if the index version number is inconsistent with the target version number.
And the query data feedback module 812 is configured to send a data update instruction, update feedback data, and a target version number to the client, where the data update instruction is used to instruct the client to update the result feedback data in the local database according to the update feedback data, and use the updated result feedback data as a data query result.
Further, the second version comparison module 810 includes:
and the state value extraction submodule 8102 is used for acquiring the integrity state value of the result feedback data from the order query request.
And the first data updating submodule 8104 is configured to, if the integrity state value is the same as a preset integrity state value in a preset database, use incremental feedback data between the index version number and the target version number as update feedback data.
Further, the second version comparison module 810 further includes:
and the second data updating submodule 8106 is configured to, if the integrity state value is the same as a preset integrity state value in a preset database, use incremental feedback data between the index version number and the target version number as update feedback data.
Further, the update instruction is further used for instructing the client to use the target version number as a new index version number.
Further, the order data feedback device further includes:
a raw order data generating module 814, configured to generate raw feedback data according to the user order.
The original version number generation module 816 is configured to calculate a version number of the original feedback data according to a preset version number generation manner, to obtain a version number of the original feedback data, and use the original feedback data as the feedback data, and use the version number of the original feedback data as the version number of the feedback data.
The original data indicating module 818 is configured to associate the feedback data with the feedback data version number and store the associated feedback data in a preset database, and send a third update instruction, the original feedback data, and an original feedback data version number to the client, where the third update instruction is used to indicate the client to use the original feedback data as result feedback data in the local database, and use the original feedback data version number as an index version number in the local database.
According to the user order data feedback device, the consistency between the feedback data version number in the local database and the feedback data version number in the preset database is judged, when the consistency is obtained, only a data updating instruction which indicates the local result feedback data of the client as a data query result needs to be sent to the client, the fact that the whole amount of feedback data is sent to each query request of the client is not needed, and the situation of network transmission resource waste caused by repeated data requests of users is greatly avoided.
For specific limitations of the order data feedback device, reference may be made to the above limitations of the order data feedback method, which is not described herein again. All or part of each module in the order data feedback device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing user order data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an order data feedback method.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, which includes a memory, a processor and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the steps of the order data feedback method in the above embodiments are implemented, for example, the steps 202 to 208 shown in fig. 2, or when the processor executes the computer program, the functions of the modules/units of the order data feedback apparatus in the above embodiments are implemented, for example, the functions of the modules 802 to 808 shown in fig. 8. To avoid repetition, further description is omitted here.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and the computer program when executed by a processor implements the steps of the order data feedback method in the above-described embodiment, such as the steps 202 to 208 shown in fig. 2, or the processor implements the functions of the modules/units of the order data feedback apparatus in the above-described embodiment, such as the functions of the modules 802 to 808 shown in fig. 8. To avoid repetition, further description is omitted here.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for those skilled in the art, without departing from the spirit and scope of the present invention, several changes, modifications and equivalent substitutions of some technical features may be made, and these changes or substitutions do not make the essence of the same technical solution depart from the spirit and scope of the technical solution of the embodiments of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. An order data feedback method is characterized by comprising the following steps:
acquiring change information of a user order, updating feedback data of the user order in a preset database and a feedback data version number associated with the feedback data according to the change information, taking the updated feedback data as target feedback data, and taking the updated feedback data version number as a target version number;
sending a first updating instruction, the target feedback data and the target version number to a client, wherein the first updating instruction is used for instructing the client to update result feedback data in a local database according to the target feedback data and instructing the client to update an index version number in the local database according to the target version number;
if an order query request of the user order is received, acquiring the index version number from the order query request;
and if the index version number is consistent with the target version number, sending a second updating instruction to the client, wherein the second updating instruction is used for indicating the client to use the result feedback data in the local database as a data query result.
2. The order data feedback method according to claim 1, wherein after the obtaining the index version number from the order query request if the order query request of the user order is received, the order data feedback method further comprises:
if the index version number is inconsistent with the target version number, acquiring updating feedback data;
and sending a data updating instruction, the updating feedback data and the target version number to the client, wherein the data updating instruction is used for instructing the client to update the result feedback data in the local database according to the updating feedback data, and taking the updated result feedback data as a data query result.
3. The order data feedback method according to claim 2, wherein said obtaining updated feedback data comprises:
acquiring a completeness state value of the result feedback data from the order query request;
and if the integrity state value is not the same as a preset integrity state value in the preset database, taking the target feedback data as the updating feedback data.
4. The order data feedback method according to claim 2, wherein said obtaining updated feedback data further comprises:
acquiring a completeness state value of the result feedback data from the order query request;
and if the integrity state value is the same as a preset integrity state value in the preset database, using incremental feedback data between the index version number and the target version number as the updating feedback data.
5. The order data feedback method according to claim 2, wherein the data update instruction is further configured to instruct the client to use the target version number as the new index version number.
6. The order data feedback method according to any one of claims 1 to 5, wherein before the obtaining of the change information of the user order, the updating of the feedback data of the user order in a preset database and the feedback data version number associated with the feedback data according to the change information, and taking the updated feedback data as the target feedback data and the updated feedback data version number as the target version number, the order data feedback method further comprises:
generating original feedback data according to a user order;
calculating the version number of the original feedback data according to a preset version number generation mode to obtain the version number of the original feedback data, and taking the original feedback data as feedback data, wherein the version number of the original feedback data is taken as the version number of the feedback data;
and storing the feedback data and the feedback data version number into the preset database after associating the feedback data and the feedback data version number, and sending a third updating instruction, the original feedback data and the original feedback data version number to a client, wherein the third updating instruction is used for indicating the client to use the original feedback data as result feedback data in a local database, and the original feedback data version number is used as an index version number in the local database.
7. An order data feedback device, characterized in that, the order data feedback device comprises:
the order data updating module is used for acquiring change information of a user order, updating feedback data of the user order in a preset database and a feedback data version number associated with the feedback data according to the change information, taking the updated feedback data as target feedback data, and taking the updated feedback data version number as a target version number;
a data update indicating module, configured to send a first update instruction, the target feedback data, and the target version number to a client, where the first update instruction is used to instruct the client to update result feedback data in a local database according to the target feedback data, and is also used to instruct the client to update an index version number in the local database according to the target version number;
the query request receiving module is used for acquiring the index version number from the order query request if the order query request of the user order is received;
and the first version comparison module is used for sending a second updating instruction to the client if the index version number is consistent with the target version number, wherein the second updating instruction is used for indicating the client to use the result feedback data in the local database as a data query result.
8. The order data feedback device according to claim 7, further comprising:
the second version comparison module is used for acquiring updating feedback data if the index version number is inconsistent with the target version number;
and the query data feedback module is used for sending a data updating instruction, the updating feedback data and the target version number to the client, wherein the data updating instruction is used for indicating the client to update the result feedback data in the local database according to the updating feedback data, and the updated result feedback data is used as a data query result.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the order data feedback method of any of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the order data feedback method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911369754.3A CN111177121A (en) | 2019-12-26 | 2019-12-26 | Order data feedback method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911369754.3A CN111177121A (en) | 2019-12-26 | 2019-12-26 | Order data feedback method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111177121A true CN111177121A (en) | 2020-05-19 |
Family
ID=70650333
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911369754.3A Pending CN111177121A (en) | 2019-12-26 | 2019-12-26 | Order data feedback method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111177121A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112817995A (en) * | 2021-02-22 | 2021-05-18 | 北京奇艺世纪科技有限公司 | Data processing method and device, electronic equipment and storage medium |
CN113596084A (en) * | 2021-06-24 | 2021-11-02 | 青岛海尔科技有限公司 | Household appliance state feedback method and system, storage medium and electronic device |
CN113836411A (en) * | 2021-09-22 | 2021-12-24 | 上海哔哩哔哩科技有限公司 | Data processing method and device and computer equipment |
CN114598559A (en) * | 2021-07-22 | 2022-06-07 | 湖南亚信软件有限公司 | Data processing method and device, electronic equipment and computer readable storage medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109034982A (en) * | 2018-09-05 | 2018-12-18 | 满金坝(深圳)科技有限公司 | Order information accelerated processing method and device in millions order table |
-
2019
- 2019-12-26 CN CN201911369754.3A patent/CN111177121A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109034982A (en) * | 2018-09-05 | 2018-12-18 | 满金坝(深圳)科技有限公司 | Order information accelerated processing method and device in millions order table |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112817995A (en) * | 2021-02-22 | 2021-05-18 | 北京奇艺世纪科技有限公司 | Data processing method and device, electronic equipment and storage medium |
CN112817995B (en) * | 2021-02-22 | 2023-09-15 | 北京奇艺世纪科技有限公司 | Data processing method and device, electronic equipment and storage medium |
CN113596084A (en) * | 2021-06-24 | 2021-11-02 | 青岛海尔科技有限公司 | Household appliance state feedback method and system, storage medium and electronic device |
CN113596084B (en) * | 2021-06-24 | 2023-10-24 | 青岛海尔科技有限公司 | Household appliance state feedback method and system, storage medium and electronic device |
CN114598559A (en) * | 2021-07-22 | 2022-06-07 | 湖南亚信软件有限公司 | Data processing method and device, electronic equipment and computer readable storage medium |
CN114598559B (en) * | 2021-07-22 | 2024-06-07 | 湖南亚信软件有限公司 | Data processing method, device, electronic equipment and computer readable storage medium |
CN113836411A (en) * | 2021-09-22 | 2021-12-24 | 上海哔哩哔哩科技有限公司 | Data processing method and device and computer equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109474578B (en) | Message checking method, device, computer equipment and storage medium | |
CN108573371B (en) | Data approval method, device, computer equipment and storage medium | |
CN109087054B (en) | Collaborative office data stream processing method, device, computer equipment and storage medium | |
CN111177121A (en) | Order data feedback method and device, computer equipment and storage medium | |
AU2016382908B2 (en) | Short link processing method, device and server | |
CN108924250B (en) | Service request processing method and device based on block chain and computer equipment | |
CN111310427A (en) | Service data configuration processing method and device, computer equipment and storage medium | |
CN111324905A (en) | Image data labeling method and device, computer equipment and storage medium | |
CN110213392B (en) | Data distribution method and device, computer equipment and storage medium | |
CN111177776A (en) | Multi-tenant data isolation method and system | |
CN109101232B (en) | Method, device, computer equipment and storage medium for product development | |
CN108512948B (en) | Address book updating method and device, computer equipment and storage medium | |
CN111488626A (en) | Data processing method, device, equipment and medium based on block chain | |
CN113515322B (en) | Application program loading method and device, computer equipment and readable storage medium | |
CN108389124B (en) | Data processing method, data processing device, computer equipment and storage medium | |
CN108334452B (en) | Rule data transfer test method, apparatus, computer device and storage medium | |
CN112860463B (en) | Service request forwarding method, device, computer equipment and readable storage medium | |
CN112560939B (en) | Model verification method and device and computer equipment | |
CN110765131B (en) | Data compression method and device for goods source data, computer equipment and storage medium | |
CN112685115A (en) | International cue language generating method, system, computer equipment and storage medium | |
CN111985871A (en) | Logistics data processing method, device, equipment and storage medium | |
CN111339170A (en) | Data processing method and device, computer equipment and storage medium | |
CN115982279A (en) | Data synchronization method, device and system and computer equipment | |
US20230049322A1 (en) | Information processing method, device, system, and computer-readable storage medium | |
CN111666290A (en) | Data replacement method, device, computer equipment and medium based on artificial intelligence |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |