CN111818117A - Data updating method and device, storage medium and electronic equipment - Google Patents

Data updating method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111818117A
CN111818117A CN201911158480.3A CN201911158480A CN111818117A CN 111818117 A CN111818117 A CN 111818117A CN 201911158480 A CN201911158480 A CN 201911158480A CN 111818117 A CN111818117 A CN 111818117A
Authority
CN
China
Prior art keywords
data
client
intermediate server
update
updating
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
Application number
CN201911158480.3A
Other languages
Chinese (zh)
Inventor
王奇峰
杨泽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Didi Infinity Technology and Development Co Ltd
Original Assignee
Beijing Didi Infinity Technology and Development Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Didi Infinity Technology and Development Co Ltd filed Critical Beijing Didi Infinity Technology and Development Co Ltd
Priority to CN201911158480.3A priority Critical patent/CN111818117A/en
Publication of CN111818117A publication Critical patent/CN111818117A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Abstract

The present disclosure provides a method, an apparatus, a storage medium and an electronic device for updating data, wherein the method comprises: the method comprises the steps that an intermediate server sends a first acquisition request to a server to acquire update data of the server; the intermediate server stores the updating data and modifies the version number of the updating data stored locally; the intermediate server sends a first data updating notification message to the client to prompt the client to acquire the updating data. The embodiment of the disclosure establishes the framework of the client, the intermediate server and the server, changes the existing short connection into the long connection, reduces unnecessary handshaking (namely mutual identity authentication process) between the client and the server, obtains the update data executed by the intermediate server, and the client only needs to obtain the update data according to the first data update notification message of the intermediate server, so that the processing process of the client is reduced, the operation efficiency of the client is greatly improved, and the interaction performance of the whole system is obviously improved.

Description

Data updating method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of data processing, and in particular, to a method and an apparatus for updating data, a storage medium, and an electronic device.
Background
In the process of browsing a webpage or running an application program, a large amount of content to be updated exists, the updated content may be located at different servers (such as servers or databases), and in order to bring a good use experience to a user, a client needs to acquire update data quickly and timely.
Js, in order to avoid refreshing a web page or restarting an application program to obtain the latest data or version, a client implemented by node needs to continuously query whether data is updated from a server. Js is a JavaScript running environment based on Chrome V8 engine. Js uses an event-driven, non-blocking I/O (input/output) model, making it lightweight and efficient. Js is a single-threaded, asynchronous I/O, event-driven language, so the manner of polling the server by the client greatly affects the operating efficiency of the client, resulting in poor system performance.
Disclosure of Invention
In view of this, the embodiments of the present disclosure provide a method, an apparatus, a storage medium, and an electronic device for updating data, so as to solve the following problems in the prior art: js is a single-threaded, asynchronous I/O, event-driven language, so the manner of polling the server by the client greatly affects the operating efficiency of the client, resulting in poor system performance.
In one aspect, an embodiment of the present disclosure provides a method for updating data, including: the method comprises the steps that an intermediate server sends a first acquisition request to a server to acquire update data of the server; the intermediate server stores the updating data and modifies the version number of the updating data stored locally; and the intermediate server sends a first data updating notification message to the client to prompt the client to acquire the updating data.
In some embodiments, after the intermediate server sends the first data update notification message to the client, the method further includes: and the intermediate server sends a version updating notification message to the client, wherein the version updating notification message carries the version number of the updating data.
In some embodiments, after the intermediate server sends the first data update notification message to the client, the method further includes: and the intermediate server receives a version number query request from the client and sends the version number of the updating data to the client.
In some embodiments, before the sending, by the intermediate server, the first acquisition request to the server, the method further includes: the intermediate server sends a query request to the server at preset time intervals to determine whether the updated data exists; or, the intermediate server receives a second data update notification message from the server.
In some embodiments, the method further comprises: setting an update identifier of the update data to a first state in the case that the intermediate server stores the update data, wherein the update identifier is used for indicating whether the first data update notification message is sent to the client; setting the update flag to a second state in a case where the first data update notification message has been sent to the client.
On the other hand, an embodiment of the present disclosure provides a method for updating data, including: the client receives a first data updating notification message from the intermediate server; the client sends a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server; and the client updates local old data by using the acquired update data.
In some embodiments, the sending, by the client, a second retrieval request to the intermediate server to retrieve the update data stored by the intermediate server includes: comparing whether the version number of the updated data carried in the version update notification message is higher than the version number of the local old data or not under the condition that the client receives the version update notification message from the intermediate server; and under the condition that the version number of the local old data is higher than that of the local old data, the client sends the second acquisition request to the intermediate server to acquire the updating data stored by the intermediate server.
In some embodiments, the sending, by the client, a second retrieval request to the intermediate server to retrieve the update data stored by the intermediate server includes: under the condition that the client receives a first data updating notification message from the intermediate server, the client sends a version number query request of the updating data to the intermediate server to acquire the version number of the updating data stored by the intermediate server; comparing whether the version number of the updated data is higher than the version number of the local old data; and under the condition that the version number of the local old data is higher than that of the local old data, the client sends a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server.
On the other hand, an embodiment of the present disclosure provides an apparatus for updating data, including: the first sending module is used for sending a first obtaining request to a server so as to obtain the update data of the server; the storage module is used for storing the updating data and modifying the version number of the updating data stored locally; and the second sending module is used for sending the first data updating notification message to the client so as to prompt the client to acquire the updating data.
In some embodiments, further comprising: a third sending module, configured to send a version update notification message to the client, where the version update notification message carries the version number of the update data.
In some embodiments, further comprising: and the fourth sending module is used for receiving the version number query request from the client and sending the version number of the update data to the client.
In some embodiments, further comprising: the confirmation module is used for sending a query request to the server according to a preset time interval so as to determine whether the updated data exists; or receiving a second data update notification message from the server.
In some embodiments, further comprising: the setting module is used for setting an update identifier of the update data to be in a first state under the condition that the update data is stored, wherein the update identifier is used for indicating whether the first data update notification message is sent to the client side or not; setting the update flag to a second state in a case where the first data update notification message has been sent to the client.
On the other hand, an embodiment of the present disclosure provides an apparatus for updating data, including: the receiving module is used for receiving a first data updating notification message from the intermediate server; a fifth sending module, configured to send a second obtaining request to the intermediate server to obtain the update data stored by the intermediate server; and the updating module is used for updating local old data by the client by using the acquired updating data.
In another aspect, an embodiment of the present disclosure provides a storage medium storing a computer program, where the computer program is executed by a processor to implement the method provided in any embodiment of the present disclosure.
In another aspect, an embodiment of the present disclosure provides an electronic device, which at least includes a memory and a processor, where the memory stores a computer program thereon, and the processor implements the method provided in any embodiment of the present disclosure when executing the computer program on the memory.
Compared with the client and server architectures in the prior art, the intermediate server is arranged, the architectures of the client, the intermediate server and the server are established, the existing short connection is changed into the long connection, unnecessary handshaking (namely identity authentication processes) between the client and the server are reduced, the update data is acquired by the intermediate server, the client only needs to acquire the update data according to the first data update notification message of the intermediate server, the processing process of the client is reduced, the operating efficiency of the client is greatly improved, and the interactive performance of the whole system is obviously improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for updating data according to a first embodiment of the present disclosure;
fig. 2 is a flowchart of a method for updating data according to a second embodiment of the disclosure;
fig. 3 is a flowchart of a method for updating data according to a third embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a data updating apparatus according to a fourth embodiment of the disclosure;
fig. 5 is a schematic structural diagram of a data updating apparatus according to a fifth embodiment of the present disclosure;
fig. 6 is a schematic architecture diagram of a data interaction system according to a sixth embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device according to an eighth embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described below clearly and completely with reference to the accompanying drawings of the embodiments of the present disclosure. It is to be understood that the described embodiments are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the disclosure without any inventive step, are within the scope of protection of the disclosure.
Unless otherwise defined, technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this disclosure belongs. The use of "first," "second," and similar terms in this disclosure is not intended to indicate any order, quantity, or importance, but rather is used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used merely to indicate relative positional relationships, and when the absolute position of the object being described is changed, the relative positional relationships may also be changed accordingly.
To maintain the following description of the embodiments of the present disclosure clear and concise, a detailed description of known functions and known components have been omitted from the present disclosure.
A first embodiment of the present disclosure provides a method for updating data, where the flow of the method is shown in fig. 1, and the method includes steps S101 to S103:
s101, the intermediate server sends a first acquisition request to the server to acquire the update data of the server.
Compared with the client and server architectures in the prior art, the intermediate server is arranged between the client and the server, and the intermediate server sends a first acquisition request for acquiring the update data to the server. The server side sends the updating data to the intermediate server based on the first obtaining request.
Before the intermediate server sends the first acquisition request to the server, the intermediate server can actively inquire whether the update data exists or not from the server, namely, the intermediate server sends a query request to the server according to a preset time interval so as to determine whether the update data exists or not; of course, it may also be that the server actively notifies the intermediate server when there is update data, and then the intermediate server receives a second data update notification message from the server. No matter how the server side is known to have the updated data, the operation efficiency of the client side cannot be influenced.
S102, the intermediate server stores the updating data and modifies the version number of the updating data stored locally.
In the initial state, the data maintained by the intermediate server is the initial value of the page configuration data, and the version number is also the initial number, for example, V0. The version number can be placed at the head end of the data, or at the tail end of the data, or stored separately, and the storage mode is preferably consistent with that of the client. After the intermediate server obtains the updating data, storing the updating data; the version number of the modified update data stored locally may be to overwrite an original version number, or may be to increase the version number corresponding to the update data, so that the application program of the subsequent client is supported when performing version rollback.
S103, the intermediate server sends a first data updating notification message to the client to prompt the client to acquire the updating data.
After the intermediate server sends the first data update notification message with the update data to the client, the client acquires the update data from the intermediate server, and the acquisition process of the update data is similar to the process of the intermediate server acquiring the update data from the server.
The first data update notification message is sent by the intermediate server to the client, and the second data update notification message is different from the first data update notification message only in that the second data update notification message is sent by the server to the intermediate server, but the message structures of the second data update notification message and the first data update notification message may be identical.
Compared with the client and server architectures in the prior art, the intermediate server is arranged, the architectures of the client, the intermediate server and the server are established, the existing short connection is changed into the long connection, unnecessary handshaking (namely identity authentication processes) between the client and the server is reduced, the acquisition of the update data is executed by the intermediate server, the client only needs to acquire the update data according to the first data update notification message of the intermediate server, the processing process of the client is reduced, the operating efficiency of the client is greatly improved, and the interactive performance of the whole system is obviously improved.
A second embodiment of the present disclosure provides a method for updating data, where the flow of the method is shown in fig. 2, and the method includes steps S201 to S205:
s201, the intermediate server sends a first acquisition request to the server to acquire the update data of the server.
Compared with the client and server architectures in the prior art, the intermediate server is arranged between the client and the server, and the intermediate server sends a first acquisition request for acquiring the update data to the server. The server side sends the updating data to the intermediate server based on the first obtaining request.
The update data may be any data that the client does not actively acquire through use, for example, a new icon of a certain website is replaced on the server.
Before the intermediate server sends the first acquisition request to the server, the intermediate server can actively inquire whether the update data exists or not from the server, namely, the intermediate server sends a query request to the server according to a preset time interval so as to determine whether the update data exists or not; of course, it may also be that the server actively notifies the intermediate server when there is update data, and then the intermediate server receives a second data update notification message from the server. No matter how the server side is known to have the updated data, the operation efficiency of the client side cannot be influenced.
S202, the intermediate server stores the updating data and modifies the version number of the updating data stored locally.
In the initial state, the data maintained by the intermediate server is the initial value of the page configuration data, and the version number is also the initial number, for example, V0. The version number can be placed at the head end of the data, or at the tail end of the data, or stored separately, and the storage mode is preferably consistent with that of the client. After the intermediate server obtains the updating data, storing the updating data; the version number of the modified update data stored locally may be to overwrite an original version number, or may be to increase the version number corresponding to the update data, so that the application program of the subsequent client is supported when performing version rollback.
S203, the intermediate server sends a first data updating notification message to the client to prompt the client to acquire the updating data.
After the intermediate server sends the first data update notification message with the update data to the client, the client acquires the update data from the intermediate server, and the acquisition process of the update data is similar to the process of the intermediate server acquiring the update data from the server.
The first data update notification message is sent by the intermediate server to the client, and the second data update notification message is different from the first data update notification message only in that the second data update notification message is sent by the server to the intermediate server, but the message structures of the second data update notification message and the first data update notification message may be identical.
S204, the intermediate server sends a version updating notification message to the client, wherein the version updating notification message carries the version number of the updating data.
S205, the intermediate server receives the version number query request from the client and sends the version number of the update data to the client.
The above-described two processes of S204 and S205 are usually performed only one of them. If the intermediate server sends the version updating notification message to the client, the client does not inquire the intermediate server again because the client knows the version number of the updating data; if the intermediate server does not send the version updating notification message to the client, the client will inquire, the intermediate server will receive the version number query request from the client, and then send the version number of the updating data to the client.
In storing the update data, the intermediate server may store it in non-volatile memory to prevent loss of the stored data due to a power loss or other unexpected event. In order to prevent the problem that the client is not aware of the existence of the update data due to this occurrence, in a preferred embodiment, a corresponding update identifier may also be set for each update data to indicate whether the first data update notification message has been sent to the client. Specifically, under the condition that the intermediate server stores the update data, the update identifier of the update data is set to be in a first state; in case the first data update notification message has been sent to the client, the update flag is set to the second state. The first state is different from the second state, the first state is used for recording a state of acquiring but not sending the first data updating notification message to the client, and the second state is used for recording a state of acquiring and sending the first data updating notification message to the client.
Compared with the client and server architectures in the prior art, the intermediate server is arranged, the architectures of the client, the intermediate server and the server are established, the existing short connection is changed into the long connection, unnecessary handshaking (namely identity authentication processes) between the client and the server is reduced, the acquisition of the update data is executed by the intermediate server, the client only needs to acquire the update data according to the first data update notification message of the intermediate server, the processing process of the client is reduced, the operating efficiency of the client is greatly improved, and the interactive performance of the whole system is obviously improved.
A third embodiment of the present disclosure provides a method for updating data, where the method is a process in which a client interacts with an intermediate server in the first embodiment or the second embodiment, and a flow of the method is shown in fig. 3, and includes steps S301 to S303:
s301, the client receives a first data updating notification message from the intermediate server.
S302, the client sends a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server.
Since the first data update notification message has notified the client that there is update data, the client may send a second acquisition request to the intermediate server to acquire the update data, which is similar to the process in which the intermediate server acquires the update data from the server.
And S303, the client updates the local old data by using the acquired updating data.
Because the updated data is obtained, the local old data corresponding to the updated data can be searched, and then the local old data is replaced by the updated data, so that the purpose of updating the data is achieved.
The client side and the intermediate server are interactive, the intermediate server obtains the update data from the server side, the client side obtains the update data from the intermediate server only under the condition that the first data update notification message sent by the intermediate server is received, the client side does not need to poll the server side according to the existing mode, and the data processing complexity of the client side is reduced.
In the process that the client sends a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server, if the intermediate server sends a version update notification message to the client, the client does not inquire the intermediate server again because the client knows the version number of the update data; if the intermediate server does not send the version updating notification message to the client, the client will inquire, the intermediate server will receive the version number query request from the client, and then send the version number of the updating data to the client.
For the client, under the condition that the client receives the version updating notification message from the intermediate server, comparing whether the version number of the updating data carried in the version updating notification message is higher than the version number of the local old data or not; under the condition that the version number of the old data is higher than that of the local old data, the client sends a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server;
for the client, under the condition that the client receives a first data updating notification message from the intermediate server, the client sends a version number query request of updating data to the intermediate server so as to acquire the version number of the updating data stored by the intermediate server; comparing whether the version number of the updated data is higher than that of the local old data; and in the case of the version number of the old data higher than the local version number, the client sends a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server.
According to the embodiment of the invention, unnecessary handshake (namely mutual identity authentication process) between the client and the server is reduced, the acquisition of the update data is executed by the intermediate server, the processing process of the client is reduced, the operation efficiency of the client is greatly improved, and the interaction performance of the whole system is obviously improved.
A fourth embodiment of the present disclosure provides an apparatus for updating data, which may be disposed in a server, and a schematic structure of the apparatus is shown in fig. 4, where the apparatus includes:
a first sending module 10, configured to send a first obtaining request to a server to obtain update data of the server; a storage module 20, coupled to the first sending module 10, for storing the update data and modifying a locally stored version number of the update data; and a second sending module 30, coupled to the storage module 20, for sending a first data update notification message to the client to prompt the client to obtain the update data.
Compared with the client and server architectures in the prior art, the intermediate server is arranged between the client and the server, and the intermediate server sends a first acquisition request for acquiring the update data to the server. The server side sends the updating data to the intermediate server based on the first obtaining request.
The update data may be any data that the client does not actively acquire through use, for example, a new icon of a certain website is replaced on the server.
Before the intermediate server sends the first acquisition request to the server, the intermediate server may actively inquire whether the server has the update data, or actively inform the intermediate server when the server has the update data. Accordingly, the above apparatus further comprises: the confirming module is coupled with the first sending module and used for sending a query request to the server side according to a preset time interval so as to determine whether the updated data exists or not; or receiving a second data updating notification message from the server. No matter how the server side is known to have the updated data, the operation efficiency of the client side cannot be influenced.
In the initial state, the data maintained by the intermediate server is the initial value of the page configuration data, and the version number is also the initial number, for example, V0. The version number can be placed at the head end of the data, or at the tail end of the data, or stored separately, and the storage mode is preferably consistent with that of the client. After the intermediate server obtains the updating data, storing the updating data; the version number of the modified update data stored locally may be to overwrite an original version number, or may be to increase the version number corresponding to the update data, so that the application program of the subsequent client is supported when performing version rollback.
After the intermediate server sends the first data update notification message with the update data to the client, the client acquires the update data from the intermediate server, and the acquisition process of the update data is similar to the process of the intermediate server acquiring the update data from the server.
The first data update notification message is sent by the intermediate server to the client, and the second data update notification message is different from the first data update notification message only in that the second data update notification message is sent by the server to the intermediate server, but the message structures of the second data update notification message and the first data update notification message may be identical.
In a preferred embodiment, the above apparatus further comprises: the third sending module is coupled with the second sending module and used for sending a version updating notification message to the client, wherein the version updating notification message carries the version number of the updating data; and the fourth sending module is coupled with the second sending module and used for receiving the version number query request from the client and sending the version number of the updating data to the client.
In implementation, if the intermediate server sends a version update notification message to the client, the client does not inquire the intermediate server again because the client knows the version number of the update data; if the intermediate server does not send the version updating notification message to the client, the client will inquire, the intermediate server will receive the version number query request from the client, and then send the version number of the updating data to the client.
In storing the update data, the intermediate server may store it in non-volatile memory to prevent loss of the stored data due to a power loss or other unexpected event. In order to prevent the client from being unaware of the existence of the updated data due to the occurrence of the situation, in a preferred embodiment, the apparatus further includes: the setting module is used for setting an update identifier of the update data to be in a first state under the condition that the update data is stored, wherein the update identifier is used for indicating whether a first data update notification message is sent to the client; in case the first data update notification message has been sent to the client, the update flag is set to the second state.
Compared with the client and server architectures in the prior art, the intermediate server is arranged, the architectures of the client, the intermediate server and the server are established, the existing short connection is changed into the long connection, unnecessary handshaking (namely identity authentication processes) between the client and the server is reduced, the acquisition of the update data is executed by the intermediate server, the client only needs to acquire the update data according to the first data update notification message of the intermediate server, the processing process of the client is reduced, the operating efficiency of the client is greatly improved, and the interactive performance of the whole system is obviously improved.
A fifth embodiment of the present disclosure provides an apparatus for updating data, which may be disposed in a client, and interact with the apparatus in the fourth embodiment, and a schematic structure of the apparatus is shown in fig. 5, where the apparatus includes:
a receiving module 40, configured to receive a first data update notification message from an intermediate server; a fifth sending module 50, coupled to the receiving module 40, configured to send a second obtaining request to the intermediate server to obtain the update data stored by the intermediate server; and an updating module 60, coupled to the fifth sending module 50, for updating, by the client, the local old data with the acquired update data.
In the process of sending a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server, if the intermediate server sends a version update notification message, the intermediate server is not queried for the version number again; if the intermediate server does not send a version update notification message, it needs to query the version number.
Based on the above considerations, the fifth sending module may specifically be configured to: under the condition of receiving a version updating notification message from the intermediate server, comparing whether the version number of the updating data carried in the version updating notification message is higher than the version number of the local old data or not; and in the case of the version number of the old data higher than the local version number, sending a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server.
Or, the fifth sending module may be further specifically configured to: under the condition of receiving a first data updating notification message from the intermediate server, sending a version number query request of updating data to the intermediate server to acquire a version number of the updating data stored by the intermediate server; comparing whether the version number of the updated data is higher than that of the local old data; and in the case of the version number of the old data higher than the local version number, sending a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server.
Compared with the client and server architectures in the prior art, the intermediate server is arranged, unnecessary handshaking (namely, identity authentication processes) between the client and the server is reduced, the acquisition of the update data is executed by the intermediate server, the client only needs to acquire the update data according to the first data update notification message of the intermediate server, the processing processes of the client are reduced, the operating efficiency of the client is greatly improved, and the interactive performance of the whole system is obviously improved.
A sixth embodiment of the present disclosure provides a data interaction system, an architecture of which is schematically shown in fig. 6, and the system includes: a back-end server (i.e., a type of server), an intermediate server, and a client. The work flow of the intermediate server is the same as that in the first embodiment or the second embodiment, and the work flow of the client is the same as that in the third embodiment, which is not described herein again, and the following describes the overall work flow of the above system with reference to fig. 6.
In the embodiment of the disclosure, a layer of intermediate server is arranged between the client and the traditional back-end server, and on one hand, the intermediate server and the back-end server interactively acquire the update data (namely, the current latest data) and on the other hand, the intermediate server timely notifies the client to acquire the update data. And after receiving the notification of data updating, the client calls a corresponding data acquisition module to acquire the updated data from the intermediate server.
(1) And the intermediate server maintains the configuration data needing to be updated and performs version control according to the updating time.
In the initial state, the data maintained by the intermediate server is the initial value of the data used in the page configuration, and the version number is also the initial version number, for example, V0. The version number can be placed at the head end of the data, or at the tail end of the data, or stored separately, and the storage mode is preferably consistent with that of the client. The above process is actually a comparison process, that is, whether the comparison resources are consistent, for example, when the data is a picture, whether the addresses of the updated picture and the original picture are consistent, and for example, when the data is an article, the basis of the comparison may also be the word count of the article.
And if the data is updated at the rear end, the intermediate server updates the configuration data and increases the version number after acquiring the updated data.
If the application supports version rollback, historical configuration data and corresponding version numbers need to be saved.
(2) The intermediate server and the back-end server interact to obtain the update data, which can be any feasible way.
In the polling mode, the intermediate server inquires the back-end server whether data is updated at certain time intervals, for example, the inquiry can be set once every 1 s; in the event notification mode, a rear-end server triggers a notification event, and an intermediate server responds to pull data in time after receiving the notification; of course, other suitable implementations are possible and will not be described in detail herein.
(3) And after the intermediate server acquires the updating data, the version number of the updating data is stored and triggers an event to notify the client to acquire the updating data.
The intermediate server, upon obtaining the update data from the back-end server, also updates the version numbers, for example from V0 to V1.
And triggering a notification event and waiting for a client response.
(4) After receiving the trigger event, the client interacts with the intermediate server to judge whether the current data version is latest, and if not, the client acquires the data of the latest version from the intermediate server and stores the version number of the updated data.
The client can firstly inquire the intermediate server to obtain the latest version number, and if the client is the latest version, the client does not need to pull data; if the client is not the latest version, the data acquisition module is called to pull the latest configuration data from the intermediate server, and the version number of the client is updated.
In the implementation process, the intermediate server needs to backup and store the data, so that the storage data loss caused by power failure or other accidents is prevented.
The intermediate server needs to backup the maintained configuration data to a memory which is not lost when power failure occurs, so that the loss of the power failure data is prevented. In a time period when the intermediate server has acquired the update data from the backend server but the client has not pulled the data yet, if the intermediate server accidentally crashes, the client cannot acquire the update data. In order to prevent this, an update flag (stored in the power-down non-loss memory) needs to be set, and after the intermediate server is online again, the intermediate server needs to check the update flag to determine whether to trigger event notification to the client.
A seventh embodiment of the present disclosure provides a storage medium storing a computer program, which when executed by a processor implements the method provided in any of the embodiments of the present disclosure, and illustratively, includes the following steps S11 to S13:
s11, sending a first acquisition request to the server to acquire the update data of the server;
s12, storing the updating data and modifying the version number of the updating data stored locally;
and S13, sending a first data updating notification message to the client to prompt the client to acquire the updating data.
After the computer program is executed by the processor to send the first data update notification message to the client, the computer program is further executed by the processor to: and the intermediate server sends a version updating notification message to the client, wherein the version updating notification message carries the version number of the updating data.
After the computer program is executed by the processor to send the first data update notification message to the client, the computer program is further executed by the processor to: and the intermediate server receives the version number query request from the client and sends the version number of the updating data to the client.
Before the step of sending the first acquisition request to the server is executed by the processor, the computer program is further executed by the processor as follows: the intermediate server sends a query request to the server at preset time intervals to determine whether the updated data exists; or the intermediate server receives a second data updating notification message from the server.
The computer program is further executable by the processor to perform the steps of: setting an update identifier of the update data to be in a first state under the condition of storing the update data, wherein the update identifier is used for indicating whether a first data update notification message is sent to a client; in case the first data update notification message has been sent to the client, the update flag is set to the second state.
The seventh embodiment of the present disclosure further provides a storage medium storing a computer program, which when executed by a processor implements the method provided in any embodiment of the present disclosure, and illustratively, the method includes the following steps S21 to S23:
s21, receiving a first data updating notification message from the intermediate server;
s22, sending a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server;
and S23, updating the local old data by using the acquired updated data.
When the computer program is executed by the processor to send the second acquisition request to the intermediate server to acquire the update data stored by the intermediate server, the computer program is specifically executed by the processor to perform the following steps: under the condition that the client receives the version updating notification message from the intermediate server, comparing whether the version number of the updating data carried in the version updating notification message is higher than the version number of the local old data or not; and in the case of the version number of the old data higher than the local version number, the client sends a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server.
When the computer program is executed by the processor to send the second acquisition request to the intermediate server to acquire the update data stored by the intermediate server, the computer program is specifically executed by the processor to perform the following steps: under the condition that the client receives a first data updating notification message from the intermediate server, the client sends a version number query request of updating data to the intermediate server so as to acquire the version number of the updating data stored by the intermediate server; comparing whether the version number of the updated data is higher than that of the local old data; and in the case of the version number of the old data higher than the local version number, the client sends a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server.
Compared with the client and server architectures in the prior art, the intermediate server is arranged, the architectures of the client, the intermediate server and the server are established, the existing short connection is changed into the long connection, unnecessary handshaking (namely identity authentication processes) between the client and the server is reduced, the acquisition of the update data is executed by the intermediate server, the client only needs to acquire the update data according to the first data update notification message of the intermediate server, the processing process of the client is reduced, the operating efficiency of the client is greatly improved, and the interactive performance of the whole system is obviously improved.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes. Optionally, in this embodiment, the processor executes the method steps described in the above embodiments according to the program code stored in the storage medium. Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again. It will be apparent to those skilled in the art that the modules or steps of the present disclosure described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. As such, the present disclosure is not limited to any specific combination of hardware and software.
An eighth embodiment of the present disclosure provides an electronic device, as shown in fig. 7, the electronic device at least includes a memory 901 and a processor 902, the memory 901 stores a computer program thereon, the processor 902 implements the method provided in any embodiment of the present disclosure when executing the computer program on the memory 901, for example, the computer program has the following steps S31 to S33:
s31, sending a first acquisition request to the server to acquire the update data of the server;
s32, storing the updating data and modifying the version number of the updating data stored locally;
and S33, sending a first data updating notification message to the client to prompt the client to acquire the updating data.
The processor 902, after executing the computer program stored on the memory 901 to send the first data update notification message to the client, further executes the computer program of: and the intermediate server sends a version updating notification message to the client, wherein the version updating notification message carries the version number of the updating data.
The processor 902, after executing the computer program stored on the memory 901 to send the first data update notification message to the client, further executes the computer program of: and the intermediate server receives the version number query request from the client and sends the version number of the updating data to the client.
The processor 902, before executing the computer program stored on the memory 901 for sending the first acquisition request to the server, further executes the following computer program: the intermediate server sends a query request to the server at preset time intervals to determine whether the updated data exists; or the intermediate server receives a second data updating notification message from the server.
The processor 902 also executes the following computer programs stored on the memory 901: setting an update identifier of the update data to be in a first state under the condition of storing the update data, wherein the update identifier is used for indicating whether a first data update notification message is sent to a client; in case the first data update notification message has been sent to the client, the update flag is set to the second state.
The processor 902 of the electronic device implements the method provided by any of the embodiments of the present disclosure when executing the computer program on the memory 901, which illustratively includes the following steps S41 to S43:
s41, receiving a first data updating notification message from the intermediate server;
s42, sending a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server;
and S43, updating the local old data by using the acquired updated data.
When executing the computer program stored in the memory 901, which sends the second acquisition request to the intermediate server to acquire the update data stored in the intermediate server, the processor 902 specifically executes the following computer program: under the condition that the client receives the version updating notification message from the intermediate server, comparing whether the version number of the updating data carried in the version updating notification message is higher than the version number of the local old data or not; and in the case of the version number of the old data higher than the local version number, the client sends a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server.
When executing the computer program stored in the memory 901, which sends the second acquisition request to the intermediate server to acquire the update data stored in the intermediate server, the processor 902 specifically executes the following computer program: under the condition that the client receives a first data updating notification message from the intermediate server, the client sends a version number query request of updating data to the intermediate server so as to acquire the version number of the updating data stored by the intermediate server; comparing whether the version number of the updated data is higher than that of the local old data; and in the case of the version number of the old data higher than the local version number, the client sends a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server.
Compared with the client and server architectures in the prior art, the intermediate server is arranged, the architectures of the client, the intermediate server and the server are established, the existing short connection is changed into the long connection, unnecessary handshaking (namely identity authentication processes) between the client and the server is reduced, the acquisition of the update data is executed by the intermediate server, the client only needs to acquire the update data according to the first data update notification message of the intermediate server, the processing process of the client is reduced, the operating efficiency of the client is greatly improved, and the interactive performance of the whole system is obviously improved.
Moreover, although exemplary embodiments have been described herein, the scope thereof includes any and all embodiments based on the disclosure with equivalent elements, modifications, omissions, combinations (e.g., of various embodiments across), adaptations or alterations. The elements of the claims are to be interpreted broadly based on the language employed in the claims and not limited to examples described in the present specification or during the prosecution of the application, which examples are to be construed as non-exclusive. It is intended, therefore, that the specification and examples be considered as exemplary only, with a true scope and spirit being indicated by the following claims and their full scope of equivalents.
The above description is intended to be illustrative and not restrictive. For example, the above-described examples (or one or more versions thereof) may be used in combination with each other. For example, other embodiments may be used by those of ordinary skill in the art upon reading the above description. In addition, in the foregoing detailed description, various features may be grouped together to streamline the disclosure. This should not be interpreted as an intention that a disclosed feature not claimed is essential to any claim. Rather, the subject matter of the present disclosure may lie in less than all features of a particular disclosed embodiment. Thus, the following claims are hereby incorporated into the detailed description as examples or embodiments, with each claim standing on its own as a separate embodiment, and it is contemplated that these embodiments may be combined with each other in various combinations or permutations. The scope of the disclosure should be determined with reference to the appended claims, along with the full scope of equivalents to which such claims are entitled.
While the present disclosure has been described in detail with reference to the embodiments, the present disclosure is not limited to the specific embodiments, and those skilled in the art can make various modifications and alterations based on the concept of the present disclosure, and the modifications and alterations should fall within the scope of the present disclosure as claimed.

Claims (16)

1. A method of data updating, comprising:
the method comprises the steps that an intermediate server sends a first acquisition request to a server to acquire update data of the server;
the intermediate server stores the updating data and modifies the version number of the updating data stored locally;
and the intermediate server sends a first data updating notification message to the client to prompt the client to acquire the updating data.
2. The method of claim 1, wherein after the intermediate server sends the first data update notification message to the client, further comprising:
and the intermediate server sends a version updating notification message to the client, wherein the version updating notification message carries the version number of the updating data.
3. The method of claim 1, wherein after the intermediate server sends the first data update notification message to the client, further comprising:
and the intermediate server receives a version number query request from the client and sends the version number of the updating data to the client.
4. The method of claim 1, wherein before the intermediate server sends the first acquisition request to the server, the method further comprises:
the intermediate server sends a query request to the server at preset time intervals to determine whether the updated data exists; alternatively, the first and second electrodes may be,
and the intermediate server receives a second data updating notification message from the server.
5. The method of any of claims 1 to 4, further comprising:
setting an update identifier of the update data to a first state in the case that the intermediate server stores the update data, wherein the update identifier is used for indicating whether the first data update notification message is sent to the client;
setting the update flag to a second state in a case where the first data update notification message has been sent to the client.
6. A method of data updating, comprising:
the client receives a first data updating notification message from the intermediate server;
the client sends a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server;
and the client updates local old data by using the acquired update data.
7. The method of claim 6, wherein the client sending a second get request to the intermediate server to get the updated data stored by the intermediate server, comprises:
comparing whether the version number of the updated data carried in the version update notification message is higher than the version number of the local old data or not under the condition that the client receives the version update notification message from the intermediate server;
and under the condition that the version number of the local old data is higher than that of the local old data, the client sends the second acquisition request to the intermediate server to acquire the updating data stored by the intermediate server.
8. The method of claim 6, wherein the client sending a second get request to the intermediate server to get the updated data stored by the intermediate server, comprises:
under the condition that the client receives a first data updating notification message from the intermediate server, the client sends a version number query request of the updating data to the intermediate server to acquire the version number of the updating data stored by the intermediate server;
comparing whether the version number of the updated data is higher than the version number of the local old data;
and under the condition that the version number of the local old data is higher than that of the local old data, the client sends a second acquisition request to the intermediate server to acquire the update data stored by the intermediate server.
9. An apparatus for updating data, comprising:
the first sending module is used for sending a first obtaining request to a server so as to obtain the update data of the server;
the storage module is used for storing the updating data and modifying the version number of the updating data stored locally;
and the second sending module is used for sending the first data updating notification message to the client so as to prompt the client to acquire the updating data.
10. The apparatus of claim 9, further comprising:
a third sending module, configured to send a version update notification message to the client, where the version update notification message carries the version number of the update data.
11. The apparatus of claim 9, further comprising:
and the fourth sending module is used for receiving the version number query request from the client and sending the version number of the update data to the client.
12. The apparatus of claim 9, further comprising:
the confirmation module is used for sending a query request to the server according to a preset time interval so as to determine whether the updated data exists; or receiving a second data update notification message from the server.
13. The apparatus of any of claims 9 to 12, further comprising:
the setting module is used for setting an update identifier of the update data to be in a first state under the condition that the update data is stored, wherein the update identifier is used for indicating whether the first data update notification message is sent to the client side or not; setting the update flag to a second state in a case where the first data update notification message has been sent to the client.
14. An apparatus for updating data, comprising:
the receiving module is used for receiving a first data updating notification message from the intermediate server;
a fifth sending module, configured to send a second obtaining request to the intermediate server to obtain the update data stored by the intermediate server;
and the updating module is used for updating local old data by the client by using the acquired updating data.
15. A storage medium storing a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 5 when executed by a processor or realizes the steps of the method of any one of claims 6 to 8 when executed by a processor.
16. An electronic device comprising at least a memory, a processor, the memory having a computer program stored thereon, wherein the processor is adapted to carry out the steps of the method of any of claims 1 to 5 when the computer program is executed on the memory, or wherein the processor is adapted to carry out the steps of the method of any of claims 6 to 8 when the computer program is executed on the memory.
CN201911158480.3A 2019-11-22 2019-11-22 Data updating method and device, storage medium and electronic equipment Pending CN111818117A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911158480.3A CN111818117A (en) 2019-11-22 2019-11-22 Data updating method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911158480.3A CN111818117A (en) 2019-11-22 2019-11-22 Data updating method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111818117A true CN111818117A (en) 2020-10-23

Family

ID=72844576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911158480.3A Pending CN111818117A (en) 2019-11-22 2019-11-22 Data updating method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111818117A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463786A (en) * 2020-12-10 2021-03-09 上海携宁计算机科技股份有限公司 Data synchronization method, system, server and storage medium
CN113050984A (en) * 2021-03-26 2021-06-29 挂号网(杭州)科技有限公司 Resource calling method and device, electronic equipment and storage medium
CN113254098A (en) * 2021-05-21 2021-08-13 四川金熊猫新媒体有限公司 Client resource processing method and device and electronic equipment
CN114448803A (en) * 2022-01-29 2022-05-06 网宿科技股份有限公司 Configuration issuing method, electronic equipment and storage medium
CN114623838A (en) * 2022-03-04 2022-06-14 智道网联科技(北京)有限公司 Map data acquisition method and device based on Internet of vehicles and storage medium
CN114928610A (en) * 2022-05-12 2022-08-19 优车库网络科技发展(深圳)有限公司 Data update notification method, data processing method, device, equipment and medium
CN116166682A (en) * 2023-04-26 2023-05-26 国家工业信息安全发展研究中心 Data updating method and server

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040215755A1 (en) * 2000-11-17 2004-10-28 O'neill Patrick J. System and method for updating and distributing information
CN103546912A (en) * 2012-07-09 2014-01-29 中兴通讯股份有限公司 Method, device and system for upgrading version of base station
CN106790432A (en) * 2016-12-05 2017-05-31 广州谷得网络科技有限公司 A kind of Oftware updating method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040215755A1 (en) * 2000-11-17 2004-10-28 O'neill Patrick J. System and method for updating and distributing information
CN103546912A (en) * 2012-07-09 2014-01-29 中兴通讯股份有限公司 Method, device and system for upgrading version of base station
CN106790432A (en) * 2016-12-05 2017-05-31 广州谷得网络科技有限公司 A kind of Oftware updating method and device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463786A (en) * 2020-12-10 2021-03-09 上海携宁计算机科技股份有限公司 Data synchronization method, system, server and storage medium
CN113050984A (en) * 2021-03-26 2021-06-29 挂号网(杭州)科技有限公司 Resource calling method and device, electronic equipment and storage medium
CN113254098A (en) * 2021-05-21 2021-08-13 四川金熊猫新媒体有限公司 Client resource processing method and device and electronic equipment
CN114448803A (en) * 2022-01-29 2022-05-06 网宿科技股份有限公司 Configuration issuing method, electronic equipment and storage medium
CN114623838A (en) * 2022-03-04 2022-06-14 智道网联科技(北京)有限公司 Map data acquisition method and device based on Internet of vehicles and storage medium
CN114928610A (en) * 2022-05-12 2022-08-19 优车库网络科技发展(深圳)有限公司 Data update notification method, data processing method, device, equipment and medium
CN116166682A (en) * 2023-04-26 2023-05-26 国家工业信息安全发展研究中心 Data updating method and server

Similar Documents

Publication Publication Date Title
CN111818117A (en) Data updating method and device, storage medium and electronic equipment
CN102291416B (en) A kind of method and system of client and server bi-directional synchronization
US9288156B2 (en) Method and apparatus for supporting scalable multi-modal dialog application sessions
CN111897638B (en) Distributed task scheduling method and system
US20150358217A1 (en) Web Polling Method, Device and System
CN108121511B (en) Data processing method, device and equipment in distributed edge storage system
JP2009288836A (en) System failure recovery method of virtual server, and its system
WO2014166265A1 (en) Method, terminal, cache server and system for updating webpage data
CN107666493B (en) Database configuration method and equipment thereof
CN104601702B (en) Cluster remote procedure calling (PRC) method and system
WO2020019724A1 (en) Method for acquiring sensor data in server, acquisition system, and related apparatus
CN104899274A (en) High-efficiency remote in-memory database access method
CN106034113A (en) Data processing method and data processing device
CN109885347B (en) Method, device, terminal, system and storage medium for acquiring configuration data
CN110659124A (en) Message processing method and device
CN112866339A (en) Data transmission method and device, computer equipment and storage medium
CN107273047B (en) Cache management method, cache manager and storage management software
WO2023071999A1 (en) User matching method and apparatus, and device and storage medium
CN113360558B (en) Data processing method, data processing device, electronic equipment and storage medium
JP2020119018A (en) Information processing system, information processing device and program
CN115658745A (en) Data processing method, data processing device, computer equipment and computer readable storage medium
CN107306290B (en) Session sharing method and application server
CN113783921A (en) Method and device for creating cache component
CN108206933B (en) Video data acquisition method and device based on video cloud storage system
CN107332679B (en) Centerless information synchronization method and device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201023