CN110716981A - Method and device for realizing data order synchronization - Google Patents
Method and device for realizing data order synchronization Download PDFInfo
- Publication number
- CN110716981A CN110716981A CN201910335402.XA CN201910335402A CN110716981A CN 110716981 A CN110716981 A CN 110716981A CN 201910335402 A CN201910335402 A CN 201910335402A CN 110716981 A CN110716981 A CN 110716981A
- Authority
- CN
- China
- Prior art keywords
- order
- synchronized
- synchronization
- main server
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F16/275—Synchronous replication
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention provides a method and a device for realizing data order synchronization, wherein the method comprises the following steps: acquiring order information to be synchronized; the order information to be synchronized is synchronized on a main server and sub-servers of order service through a pre-established data order synchronization service unit, wherein the data order synchronization service unit is respectively arranged on the main server and the sub-servers, and the problem of real-time pushing and synchronization of the geoscience data orders under a distributed software system is solved.
Description
Technical Field
The embodiment of the invention relates to the technical field of data transmission, in particular to a method and a device for realizing data order synchronization.
Background
The scientific data of the earth system has the characteristics of dispersion, mass, multiple sources, obvious heterogeneous and space-time characteristics and the like, is particularly complex and difficult to share, and has become an important international leading edge in the field of geological research. At present, a scientific data sharing service platform of a national earth system realizes a distributed geoscience data network sharing service system and stably operates, and with the proposal of an electronic commerce idea, a data sharing service mode is also changed from an offline service mode to an online data order service mode.
Geoscience data order systems are generally classified as centralized and distributed. The centralized system refers to that a data user submits data orders to an order service system in a unified way based on a network, and the data user inquires and acquires the required data orders from the system. The distributed system is that a plurality of physically distributed and logically unified data order service systems are set according to the requirements of regions or disciplines, data users retrieve and submit to corresponding data sharing systems according to the characteristics of data resources, and the data users log in a certain data sharing system to inquire and acquire the data resources required by the data users.
The centralized system has the advantages of simplicity, easiness in maintenance and the like because only one service system is used for submitting data orders and inquiring and acquiring the orders, but the problems that the network burden is too heavy, the data orders of different systems or areas are difficult to manage and the like exist because all data services are carried out by one system.
The distributed system provides external services by means of a plurality of physically distributed and logically unified data order systems, data orders of each system or area can well manage the data orders of the system or the area, the distributed system is much more complex compared with a centralized data order system, and order synchronization among the distributed systems must be solved for the distributed system to provide data order services for users in a unified manner. Since the geoscience data resources have the characteristics of typical spatio-temporal characteristics, regional integration, discipline intersection and the like, the sharing of geoscience data orders often adopts a distributed network system.
Distributed data order synchronization generally takes two forms: equality and total fraction. The peer-to-peer synchronization means that each system under a distributed network system is peer-to-peer, and metadata of each system needs to be synchronized to other systems respectively; the general-type synchronization means that one system is used as a general center and other systems are used as branch centers under a distributed network system, the general center and the branch centers are not equal, orders of all the branch centers are synchronized to the general center, and global search and access of the orders are achieved through the general center. The peer-to-peer synchronization mechanism is characterized in that since data of one system needs to be synchronized to each other system, if the number of systems in a distributed system is large, the cost consumed by the synchronization work is huge, and any system problem affects the synchronization. In the general data synchronization mechanism, each branch center only performs data synchronization with the main center, the branch centers do not perform data synchronization with each other, the data synchronization of each branch center can be monitored by the main center, global synchronization service is provided, if the number of systems in a distributed system is large, the expense consumed by the synchronization work is huge, any system has a problem, the synchronization is influenced, and the requirement on the main center is high.
Disclosure of Invention
In order to overcome the defects in the prior art, embodiments of the present invention provide a method and an apparatus for implementing data order synchronization.
In a first aspect, an embodiment of the present invention provides a method for implementing data order synchronization, including: acquiring order information to be synchronized;
and realizing the synchronization of the order information to be synchronized on a main server and sub-servers of order service through a pre-established data order synchronization service unit, wherein the data order synchronization service unit is respectively arranged on the main server and the sub-servers.
In a second aspect, an embodiment of the present invention provides an apparatus for implementing data order synchronization, including:
the acquisition module is used for acquiring order information to be synchronized;
and the synchronization module is used for synchronizing the order information to be synchronized on a main server and a sub-server of order service through a pre-established data order synchronization service unit, wherein the data order synchronization service unit is respectively arranged on the main server and the sub-server.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory and a processor, where the processor and the memory complete communication with each other through a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform a method comprising: acquiring order information to be synchronized; and realizing the synchronization of the order information to be synchronized on a main server and sub-servers of order service through a pre-established data order synchronization service unit, wherein the data order synchronization service unit is respectively arranged on the main server and the sub-servers.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, is used to store the method of the computer program as described above.
According to the method and the device for realizing data order synchronization, provided by the embodiment of the invention, the geoscience order information operation function is encapsulated through network service to form a geoscience data order synchronization service unit, and the geoscience data order synchronization service unit is respectively deployed on the main server and the sub-servers, so that the problems of real-time pushing and synchronization of geoscience data orders under a distributed software system are solved, the operation pressure on the main server is reduced, and the synchronization efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for implementing data order synchronization according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an apparatus for implementing data order synchronization according to an embodiment of the present invention;
fig. 3 is a block diagram of a computer device according to an embodiment of the present invention.
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.
Fig. 1 is a schematic flow chart of a method for implementing data order synchronization according to an embodiment of the present invention, and as shown in fig. 1, the method includes:
s101, obtaining order information to be synchronized;
s102, synchronizing the order information to be synchronized on a main server and a sub-server of order service through a pre-established data order synchronization service unit, wherein the data order synchronization service unit is respectively arranged on the main server and the sub-server.
The system architecture of the geoscience data order provided by the embodiment of the invention adopts a distributed network system, and comprises a main server and at least one sub-server, wherein the order of the geoscience data can be received by the sub-servers and can also be received by the main server.
The method comprises the steps that a data order synchronization service unit is established in advance and is respectively arranged on a main server and sub-servers, order information received by the main server can be synchronized to the sub-servers, and the order information on the sub-servers can also be synchronized to the main server.
According to the data order synchronization implementation method provided by the embodiment of the invention, the geoscience data order synchronization service unit is arranged and is respectively deployed on the main server and the sub-servers, so that the problems of real-time pushing and synchronization of the geoscience data order under a distributed software system are solved.
Optionally, the pre-established data order synchronization service unit specifically includes: and encapsulating the function of the data order operation to form the data order synchronous service unit.
Specifically, the network service is utilized to encapsulate the function of the geoscience data order operation into a geoscience data order synchronization service unit. The network service is an object component deployed on a network, is built on a standard Internet protocol, can run on different operating systems, and provides a standard mode for the interoperation of different software applications. Once the web service is configured, other applications and web services can directly discover and invoke the service.
The Web service uses JSON (JavaScript Object Notation) to describe data, uses WSDL (Web Services Description Language) to describe Services, uses UDDI (universal Description, Discovery and Integration) to publish and find Services, and uses SOAP (Simple Object Access Protocol) to execute service call.
According to the method for realizing data order synchronization provided by the embodiment of the invention, the geoscience order information operation function is encapsulated through network service to form a geoscience data order synchronization service unit, and the geoscience data order synchronization service unit is respectively deployed on the main server and the sub-servers, so that the problems of real-time pushing and synchronization of geoscience data orders under a distributed software system are solved, the operation pressure on the main server is reduced, and the synchronization efficiency is improved.
Specifically, the function of the data order operation at least includes: judging whether the order exists in the functions of adding, updating, deleting, acquiring, updating and acquiring.
On the basis of the above embodiment, the function functions of geoscience data order synchronization operation mainly include: function existedDataPP judging whether the order exists, add function addDataPP, update function updateDataPP, delete function deleteDataPP, get state function getDataPPState, update state function updateDataPPState, and get function getDataPP.
The geoscience data order synchronization service unit provided by the embodiment of the invention is respectively deployed on the network servers of the main center and the branch center. Specifically, the deployed synchronization services have slightly different functions according to different division of labor, where the synchronization service unit of the main center includes the following functional functions: judging whether the order exists, adding the order, updating the order, obtaining the order state and updating the order state; the function contained in the synchronous service unit of the sub-center is as follows: updating orders, deleting orders of the center, obtaining order states and updating order states.
Optionally, the synchronizing the order information to be synchronized on the main server and the sub-servers served by the order through a pre-established data order synchronization service unit includes:
and if the order information to be synchronized is on the main server, the order information to be synchronized is stored in a database of the main server and is synchronized to the sub-servers through the data order synchronization service unit.
On the basis of the above embodiment, the order information to be synchronized may be on the main server or on the sub-servers, and if the user submits the data order on the platform of the main server, the order information to be synchronized is on the main server, and the data order is directly stored in the database of the main server, and the form check of the order information, including the examination of the standardability, integrity, correctness, and the like of the order information, is completed.
Optionally, the synchronizing the order information to be synchronized on the main server and the sub-servers served by the order service is realized through a pre-established data order synchronization service unit, and the method further includes:
and if the order information to be synchronized is on the sub-servers, the order information to be synchronized is stored in the databases of the sub-servers and uploaded to the main server, and the main server judges whether the order information to be synchronized exists in the database of the main server.
On the basis of the embodiment, if a user submits a data order on a platform of the sub-server, two steps are needed, firstly, the data order is stored in a database of the sub-server, meanwhile, the form of order information is checked, then, the order information is pushed to the main server, and when the order information is pushed to the main server, an existeddapp interface of synchronous service needs to be called to judge whether the order exists in the main center or not through the unique identifier.
Optionally, the determining, by the master server, whether the order information to be synchronized exists in the database of the master server includes:
if the database of the main server does not have the order information to be synchronized, calling an adding function interface of the data order synchronization service unit, and adding an order in the database of the main server.
On the basis of the above embodiment, when the main server determines the order information uploaded by the branch server, if the order information to be synchronized does not exist in the database of the main server, an addDatapp interface of the order synchronization service is called, a json file of the order is transmitted to the main server, and a piece of order information is added to the main server.
Optionally, the method for determining whether the order information to be synchronized exists in the database of the head server by the head server further includes:
if the order information to be synchronized exists in the database of the main server, an updating function interface of the data order synchronization service unit is called, and the order is updated in the database of the main server.
On the basis of the above embodiment, when the main server determines the order information uploaded by the branch server, if the order information to be synchronized exists in the database of the main server, the updateDatapp interface of the synchronization service is called to update the order corresponding to the main server through the unique identifier.
If the order content of the sub-servers is modified in the process of examination by the main server, the update data pp interface of the synchronization service unit of the sub-servers needs to be called simultaneously to synchronize the order modified content to the sub-servers.
The sub-servers can not directly delete the completed orders, and can send a deletion request to the main server when deletion is required. After the general server agrees to delete, firstly calling the deleteDatapp interface of the sub-server synchronous service unit to delete the order in the sub-server, and then calling a local deletion function in the general server to delete the order in the general server. And if the master server fails to call the sub-center synchronous service unit, automatically sending E-mail or notifying a sub-server administrator in other forms, and not performing deletion operation on the master server and the sub-servers.
The embodiment of the invention aims at the characteristics that geoscience data resources have typical space-time characteristics, regional integration, discipline intersection and the like, a distributed network system is adopted in the system architecture of geoscience data orders, and the deployment and application of a plurality of heterogeneous geoscience data order systems (a total platform and a branch platform architecture) are realized.
The embodiment of the invention encapsulates the geoscience order information operation function through the network service to form geoscience data order synchronization service, and the geoscience data order synchronization service is respectively deployed in the main center and the branch center, so that the problem of real-time pushing and synchronization of geoscience data orders under a distributed software system is solved.
Fig. 2 is a schematic structural diagram of an apparatus for implementing data order synchronization according to an embodiment of the present invention, and as shown in fig. 2, the apparatus includes: an acquisition module 10 and a synchronization module 20, wherein,
the obtaining module 10 is configured to obtain order information to be synchronized;
the synchronization module 20 is configured to synchronize the order information to be synchronized on a main server and a sub-server of the order service through a pre-established data order synchronization service unit, where the data order synchronization service unit is respectively disposed on the main server and the sub-server.
The device for realizing data order synchronization provided by the embodiment of the invention comprises an acquisition module 10 and a synchronization module 20, wherein the acquisition module 10 acquires order information to be synchronized, the synchronization module 20 synchronizes the order information to be synchronized on a main server and a sub-server of order service through a pre-established data order synchronization service unit, and the data order synchronization service unit is respectively arranged on the main server and the sub-server.
The device for realizing data order synchronization provided by the embodiment of the invention encapsulates the operation function of the geoscience order information through the network service to form a geoscience data order synchronization service unit, and deploys the geoscience data order synchronization service unit on the main server and the sub-servers respectively, thereby solving the problem of real-time pushing and synchronization of the geoscience data order under a distributed software system.
Fig. 3 is a block diagram of a computer device according to an embodiment of the present invention, and as shown in fig. 3, the server may include: a processor (processor)810, a communication Interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication Interface 820 and the memory 830 communicate with each other via the communication bus 840. The processor 810 may call logic instructions in the memory 830 to perform the following method: acquiring order information to be synchronized; and realizing the synchronization of the order information to be synchronized on a main server and sub-servers of order service through a pre-established data order synchronization service unit, wherein the data order synchronization service unit is respectively arranged on the main server and the sub-servers.
In addition, the logic instructions in the memory 830 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
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 software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
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.
Claims (10)
1. A method for realizing data order synchronization is characterized by comprising the following steps:
acquiring order information to be synchronized;
and realizing the synchronization of the order information to be synchronized on a main server and sub-servers of order service through a pre-established data order synchronization service unit, wherein the data order synchronization service unit is respectively arranged on the main server and the sub-servers.
2. The method according to claim 1, wherein the pre-established data order synchronization service unit is specifically: and encapsulating the function of the data order operation to form the data order synchronous service unit.
3. The method of claim 2, wherein the functional functions of the data order operations comprise at least: judging whether the order exists in the functions of adding, updating, deleting, acquiring, updating and acquiring.
4. The method according to claim 3, wherein the synchronizing the order information to be synchronized on the main server and the sub-servers of the order service through the pre-established data order synchronization service unit comprises:
and if the order information to be synchronized is on the main server, the order information to be synchronized is stored in a database of the main server and is synchronized to the sub-servers through the data order synchronization service unit.
5. The method according to claim 3, wherein the order information to be synchronized is synchronized on a main server and a sub-server of the order service through a pre-established data order synchronization service unit, and further comprising:
and if the order information to be synchronized is on the sub-servers, the order information to be synchronized is stored in the databases of the sub-servers and uploaded to the main server, and the main server judges whether the order information to be synchronized exists in the database of the main server.
6. The method of claim 5, wherein the determining, by the head office server, whether order information to be synchronized exists in a database of the head office server comprises:
if the database of the main server does not have the order information to be synchronized, calling an adding function interface of the data order synchronization service unit, and adding an order in the database of the main server.
7. The method of claim 5, wherein the overall server determines whether order information to be synchronized exists in a database of the overall server, further comprising:
if the order information to be synchronized exists in the database of the main server, an updating function interface of the data order synchronization service unit is called, and the order is updated in the database of the main server.
8. An apparatus for implementing data order synchronization, comprising:
the acquisition module is used for acquiring order information to be synchronized;
and the synchronization module is used for synchronizing the order information to be synchronized on a main server and a sub-server of order service through a pre-established data order synchronization service unit, wherein the data order synchronization service unit is respectively arranged on the main server and the sub-server.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the synchronization method according to any of claims 1 to 7 are implemented when the processor executes the program.
10. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the synchronization method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910335402.XA CN110716981A (en) | 2019-04-24 | 2019-04-24 | Method and device for realizing data order synchronization |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910335402.XA CN110716981A (en) | 2019-04-24 | 2019-04-24 | Method and device for realizing data order synchronization |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110716981A true CN110716981A (en) | 2020-01-21 |
Family
ID=69208784
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910335402.XA Pending CN110716981A (en) | 2019-04-24 | 2019-04-24 | Method and device for realizing data order synchronization |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110716981A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111564156A (en) * | 2020-07-03 | 2020-08-21 | 杭州摸象大数据科技有限公司 | Outbound system deployment method, outbound system deployment device, computer equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101625691A (en) * | 2009-07-07 | 2010-01-13 | 中国科学院地理科学与资源研究所 | Method and system for realizing synchronization of distributed earth science metadata |
CN106504076A (en) * | 2016-11-23 | 2017-03-15 | 杭州先手科技有限公司 | distributed order processing method, device and order processing system |
-
2019
- 2019-04-24 CN CN201910335402.XA patent/CN110716981A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101625691A (en) * | 2009-07-07 | 2010-01-13 | 中国科学院地理科学与资源研究所 | Method and system for realizing synchronization of distributed earth science metadata |
CN106504076A (en) * | 2016-11-23 | 2017-03-15 | 杭州先手科技有限公司 | distributed order processing method, device and order processing system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111564156A (en) * | 2020-07-03 | 2020-08-21 | 杭州摸象大数据科技有限公司 | Outbound system deployment method, outbound system deployment device, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106850788B (en) | Integrated framework and integrated approach towards multi-source heterogeneous geographic information resources | |
CN112019369A (en) | Dynamic configuration management method and system under micro-service framework | |
CN109063196B (en) | Data processing method and device, electronic equipment and computer readable storage medium | |
CN110837409B (en) | Method and system for executing tasks at fixed time | |
CN109547514A (en) | A kind of task processing method, device, electronic equipment and storage medium | |
CN106161644A (en) | Distributed system for data processing and data processing method thereof | |
CN110837423A (en) | Method and device for automatically acquiring data of guided transport vehicle | |
CN102207978A (en) | Database access method and system | |
CN110019539A (en) | A kind of method and apparatus that the data of data warehouse are synchronous | |
CN110213156A (en) | A kind of span centre heart group's instant communicating method and system | |
CN109525590A (en) | The transmission method and device of data packet | |
CN111767157A (en) | Request processing method and device based on service grid | |
CN106547790B (en) | Relational database service system | |
CN113596162B (en) | Mirror image file processing method and device, network equipment and storage medium | |
CN107729394A (en) | Data Mart management system and its application method based on Hadoop clusters | |
CN110716981A (en) | Method and device for realizing data order synchronization | |
CN110933145A (en) | Remote scheduling method, device, equipment and medium | |
CN116095107A (en) | Cloud edge cooperative system and cloud edge cooperative method for intelligent concrete production and control | |
CN107786661B (en) | Information synchronization method | |
CN115629909A (en) | Service data processing method and device, electronic equipment and storage medium | |
CN114760360B (en) | Request response method, request response device, electronic equipment and computer readable storage medium | |
CN115277707A (en) | Service processing method, device, electronic equipment and storage medium | |
CN110661857B (en) | Data synchronization method and device | |
CN110071949B (en) | System, method and device for managing computing application across geographic areas | |
CN106991129B (en) | Real-time database system based on SOA (service oriented architecture) framework power dispatching system and implementation method |
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 |