Disclosure of Invention
The embodiment of the invention provides a data processing method, a data processing device, data processing equipment and a storage medium, and aims to meet the technical scheme that a service merchant can timely and efficiently obtain order demands.
In a first aspect, an embodiment of the present invention provides a data updating method, where the method includes:
obtaining updated order information from a first client;
and pushing the updated order information to each second client through different pushing modes according to the historical subscription records of each second client, so that each second client can select one of the plurality of updated order information to update data.
Optionally, after obtaining the updated order information, the method further includes: and determining the second clients subscribed with the order identifications according to the order identifications carried in the updated order information.
Optionally, the pushing the updated order information to each second client through different pushing manners according to the historical subscription records of each second client includes: and if the historical subscription record of the second client side contains the order identification, pushing the updated order information to the second client side in an HTTP long connection pushing mode and/or a silent pushing mode so that each second client side can select one of the updated order information for data updating.
Optionally, the method further comprises: when the push is carried out through the HTTP long connection push mode and/or the silent push mode, the push time is carried; and if the updated order information of the same order identifier is pushed to a second client through the HTTP long connection pushing mode and the silent pushing mode, selecting one from the second client according to the pushing time to update the data.
In a second aspect, an embodiment of the present invention provides a data updating method, which is applied to a client, and the method includes:
generating a historical subscription record according to a subscription request sent to a server;
if the server side obtains the updated order information, receiving the updated order information respectively pushed by the server side through different pushing modes;
and selecting one from the plurality of updated order information for data updating.
Optionally, the different pushing manners include: HTTP long connection push mode and/or silent push mode.
Optionally, the selecting one of the plurality of updated order information for data updating includes: when the push is carried out through the HTTP long connection push mode and/or the silent push mode, the push time is carried;
and if the updated order information with the same order mark respectively pushed by the HTTP long connection pushing mode and the silent pushing mode is received, selecting one to update data according to the pushing time.
In a third aspect, an embodiment of the present invention provides a data updating apparatus, including:
the acquisition module is used for acquiring updated order information from the first client;
and the pushing module is used for pushing the updated order information to each second client through different pushing modes according to the historical subscription records of each second client, so that each second client can select one of the updated order information to update data.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including a processor, and a memory, where the memory is used to store one or more computer instructions, and when the one or more computer instructions are executed by the processor, the data updating method according to the first aspect is implemented.
In a fifth aspect, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which when executed by one or more processors causes the one or more processors to perform actions comprising:
obtaining updated order information from a first client;
and pushing the updated order information to each second client through different pushing modes according to the historical subscription records of each second client, so that each second client can select one of the plurality of updated order information to update data.
In the embodiment of the invention, updated order information is obtained from a first client; and pushing the updated order information to each second client through different pushing modes according to the historical subscription records of each second client, so that each second client can select one of the plurality of updated order information to update data. Through the scheme, when new updated order information is generated, the server side actively pushes the updated order information to the second client side, and the updated order information can be pushed in two ways simultaneously, so that the pushing success rate is ensured, and the problem that the updated order information cannot be effectively and timely obtained when the client side operates is avoided.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, and "a plurality" typically includes at least two.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.
With the popularization of internet technology, more and more applications support users to operate through clients. For example, orders may be placed or orders received for the service industry (e.g., clean, nurse, hours, etc.) through the cell phone client. It is easy to understand that the order placing is that the service demander (i.e. the client) actively sends an order placing request to the server, and then the server distributes or populates the order. If the service merchant wants to obtain the order, the service merchant needs to actively obtain the order, and usually the service merchant client (APP) needs to obtain the order in a polling mode. However, this approach is inefficient, i.e. several without new orders being generated, the APP of the service merchant also polls, but no new orders are acquired. Moreover, sometimes the polling result fails because the network or the background server is unstable. Therefore, a solution is needed to satisfy the requirement of the service merchant to obtain the updated order in time.
Fig. 1 is a schematic flowchart of a data updating method provided in an embodiment of the present application, and is applied to a server (for example, a cloud server or a server cluster), as shown in fig. 1, the method includes the following steps:
101: and obtaining the updated order information from the first client.
102: and pushing the updated order information to each second client through different pushing modes according to the historical subscription records of each second client, so that each second client can select one of the plurality of updated order information to update data.
The first client may be understood herein as a client of a customer and the second client may be understood as a client of a service merchant (e.g., a clean-keeping client, a babysitter client, etc.).
When updated order information is pushed to the second client, the order state of the service merchant corresponding to the current second client needs to be obtained according to the historical subscription record of the second client. If the service merchant is in an idle state or the current order is about to end, and the start time of the updated order is just after the current order ends, the updated service order can be pushed to the service merchant. For example, if the service type in the historical subscription record of the service merchant a is a nanny-type service, then at the time of pushing, updated order information related to the nanny-type will be pushed. And during pushing, the current order state of the service merchant A is also needed to be seen, and if the current order is finished today and the updated order information begins to take effect tomorrow, the updated order can be pushed to the service merchant.
When the server performs the push, there may be multiple ways to implement the push, and the following illustrates a process based on multiple ways.
In one or more embodiments of the present application, after obtaining the updated order information, the method further includes: and determining the second clients subscribed with the order identifications according to the order identifications carried in the updated order information.
In practical application, when a service provider subscribes an order, an order identifier is stored in the historical subscription record, and according to the order identifier, the type of the order (for example, a nurse order, a sanitation order, and the like) associated with the order identifier, an order number, an order start-stop time, and the like can be known. After determining the order identification of the updated order information, it is convenient to know to which service merchant's client the updated order needs to be assigned.
In one or more embodiments of the present application, the pushing the updated order information to each second client in different pushing manners according to the historical subscription records of each second client includes: and if the historical subscription record of the second client side contains the order identification, pushing the updated order information to the second client side in an HTTP long connection pushing mode and/or a silent pushing mode so that each second client side can select one of the updated order information for data updating.
In practical applications, in order to ensure reliable push, two ways of pushing are adopted simultaneously. In the scheme, HTTP long connection pushing and silent pushing are adopted simultaneously. That is, during pushing, the server side pushes updated order information to the same client side according to the same order. The two pushing modes are used simultaneously, so that the client can be ensured to receive order information in time. And the server side actively pushes, so that the pushing efficiency can be effectively improved, and the problem of unnecessary resource waste caused by invalid polling is solved.
In one or more embodiments of the present application, when performing push in the HTTP long connection push manner and/or the silent push manner, the push is carried with push time; and if the updated order information of the same order identifier is pushed to a second client through the HTTP long connection pushing mode and the silent pushing mode, selecting one from the second client according to the pushing time to update the data.
When pushing, the pushing time is carried, and the pushing time may be the time pushed by the server or the time when the client receives the order information.
It is easy to understand that if two pushing methods are used to push the same order to the same client at the same time, if both pushing channels are relatively smooth, both pushing methods will be successfully pushed to the client inevitably. The client selectively keeps one, that is, the client selectively keeps the updated order information pushed from one of the push channels.
When the same received updated order information is selected, the selection can be performed according to the pushing time. Specifically, after receiving the pushed updated order information, the client compares the order identifier with the existing order identifiers in the current order set, and if there is no identical order identifier, the updated order information may be added to the order set. If the same order identification exists, the pushing time is compared, and orders with earlier or later pushing time can be reserved preferentially.
Based on the embodiment, updated order information is obtained from the first client; and pushing the updated order information to each second client through different pushing modes according to the historical subscription records of each second client, so that each second client can select one of the plurality of updated order information to update data. Through the scheme, when new updated order information is generated, the server side actively pushes the updated order information to the second client side, and the updated order information can be pushed in two ways simultaneously, so that the pushing success rate is ensured, and the problem that the updated order information cannot be effectively and timely obtained when the client side operates is avoided.
Based on the same idea, the embodiment of the application also provides another data updating method. The executing agent of the method may be a client of the service merchant. Fig. 2 is a schematic flow chart of another data updating method according to an embodiment of the present application.
201: and generating a historical subscription record according to the subscription request sent to the server.
202: and if the server side obtains the updated order information, receiving the updated order information respectively pushed by the server side through different pushing modes.
203: and selecting one from the plurality of updated order information for data updating.
The subscription request referred to herein may be understood as an order request by a service merchant. All requested orders of the service merchant are stored in the historical subscription record so as to search the orders according to the historical subscription record.
As described above, when order pushing is performed, pushing can be implemented in different pushing manners. It is easy to understand that if two push channels are adopted to push the same order information to the same client at the same time, the client may receive two identical orders at the same time, and then the client is required to perform selection update.
As can be seen from the foregoing, the different pushing manners include: HTTP long connection push mode and/or silent push mode. The push process using these two push modes can be referred to as the corresponding embodiment in fig. 1, and will not be described repeatedly here.
In one or more embodiments of the present application, the selecting one of the plurality of updated order information for data updating includes: when the push is carried out through the HTTP long connection push mode and/or the silent push mode, the push time is carried; and if the updated order information with the same order mark respectively pushed by the HTTP long connection pushing mode and the silent pushing mode is received, selecting one to update data according to the pushing time.
After the client receives the updated order information pushed by the two pushing modes at the same time, the client selects one of the updated order information according to the comparison result of the pushing time and displays the updated order information on the client interaction interface. Through the scheme, the client side is not required to acquire updated order information in a polling mode, and the updated order information is actively pushed by the server side, so that the efficiency of acquiring the order information by the client side can be effectively improved; in addition, two pushing modes are adopted for pushing, so that the success rate and the efficiency of the client side for receiving the updated order information can be effectively improved.
Based on the same idea, embodiments of the present application further provide a data updating apparatus, where an execution subject of the apparatus may be a server. Fig. 3 is a schematic structural diagram of a data updating apparatus according to an embodiment of the present application. As can be seen from fig. 3, the device comprises:
an obtainingmodule 31, configured to obtain updated order information from a first client;
and the pushingmodule 32 is configured to push the updated order information to each second client through different pushing manners according to the historical subscription records of each second client, so that each second client selects one of the updated order information to update data.
The obtainingmodule 31 is further configured to determine, according to the order identifier carried in the updated order information, each second client subscribed with the order identifier.
A pushingmodule 32, configured to, if the historical subscription record of the second client includes the order identifier, push the updated order information to the second client in an HTTP long connection pushing manner and/or a silent pushing manner, so that each second client selects one of the updated order information to perform data update.
The pushingmodule 32 is further configured to carry pushing time when pushing is performed in the HTTP long connection pushing manner and/or the silent pushing manner; and if the updated order information of the same order identifier is pushed to a second client through the HTTP long connection pushing mode and the silent pushing mode, selecting one from the second client according to the pushing time to update the data.
In a possible design, the structure of the data updating apparatus shown in fig. 3 may be implemented as an electronic device, and as shown in fig. 5, a schematic structural diagram of an electronic device corresponding to the data updating apparatus provided in the embodiment shown in fig. 3 may include: aprocessor 51, amemory 52, wherein thememory 52 is used for storing one or more computer instructions, and when the one or more computer instructions are executed by theprocessor 51, the steps performed by the server in the foregoing embodiments are implemented.
Optionally, the electronic device may further include acommunication interface 53 for communicating with other devices.
In addition, an embodiment of the present invention provides a computer storage medium for storing a computer program, where the computer program enables a client to implement the data updating method in the embodiment shown in fig. 1 when the computer program is executed.
Based on the same idea, the embodiment of the present application further provides a data updating apparatus, where an execution subject of the apparatus may be a client of a service merchant. Fig. 4 is a schematic structural diagram of another data updating apparatus according to an embodiment of the present application. As can be seen from fig. 4, the device comprises:
the generatingmodule 41 is configured to generate a historical subscription record according to the subscription request sent to the server.
A receivingmodule 42, configured to receive, if the server obtains the updated order information, the updated order information respectively pushed by the server in different pushing manners.
And an updatingmodule 43, configured to select one of the updated order information for data updating.
Wherein, the different pushing modes comprise: HTTP long connection push mode and/or silent push mode.
An updatingmodule 43, configured to carry the pushing time when pushing in the HTTP long connection pushing manner and/or the silent pushing manner; and if the updated order information with the same order mark respectively pushed by the HTTP long connection pushing mode and the silent pushing mode is received, selecting one to update data according to the pushing time.
In a possible design, the structure of the data updating apparatus shown in fig. 4 may be implemented as an electronic device, and as shown in fig. 6, the electronic device corresponding to another data updating apparatus provided in the embodiment shown in fig. 4 may include: aprocessor 61, amemory 62, wherein thememory 62 is used for storing one or more computer instructions, and the one or more computer instructions, when executed by theprocessor 61, implement the steps executed by the server in the foregoing embodiments.
Optionally, the electronic device may further include acommunication interface 63 for communicating with other devices.
In addition, an embodiment of the present invention provides a computer storage medium for storing a computer program, where the computer program enables a client to implement the data updating method in the embodiment shown in fig. 2 when the computer program is executed.
Based on the embodiment, updated order information is obtained from the first client; and pushing the updated order information to each second client through different pushing modes according to the historical subscription records of each second client, so that each second client can select one of the plurality of updated order information to update data. Through the scheme, when new updated order information is generated, the server side actively pushes the updated order information to the second client side, and the updated order information can be pushed in two ways simultaneously, so that the pushing success rate is ensured, and the problem that the updated order information cannot be effectively and timely obtained when the client side operates is avoided.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course, can also be implemented by a combination of hardware and software. With this understanding in mind, the above-described aspects and portions of the present technology which contribute substantially or in part to the prior art may be embodied in the form of a computer program product, which may be embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including without limitation disk storage, CD-ROM, optical storage, and the like.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable resource updating apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable resource updating apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable resource updating apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable resource updating apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.