Base library synchronization method, device and electronic system
Receive and update the base library of portable devices through the external network synchronization server, which solves the problems of lag in updating the base library of portable devices and inconvenient operation, realizes timely synchronization of portable devices and the inner network base, and simplifies the update process.
Patent Information
- Application Number
- CN202010546660.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-15
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-06-15
AI Technical Summary
There is a lag problem in the base library update of portable devices, and the update operation is inconvenient. It cannot be directly connected to the intranet, and the data needs to be copied through a USB flash drive or a third-party storage device.
By setting up a synchronization server on the external network, it receives the Oplog file generated by the business server, updates the external network bottom library collection, and responds to the synchronization request of the portable device, updates its local bottom library collection, and achieves timely synchronization between the portable device and the intranet bottom library.
There is no need for portable devices to configure additional storage hardware, which enables rapid synchronization of the base database, alleviates the problem of update lag, simplifies operations, and facilitates promotion and implementation.
Smart Images

Figure CN111858749B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of database synchronization, and in particular to a base database synchronization method, device and electronic system. Background Art
[0002] With the development of deep learning algorithms and artificial neural network theory, the accuracy of face recognition is getting higher and higher. With the optimization of algorithms and the increase in computing power of edge and end devices, the database can be stored in portable devices and face comparison can be performed on portable devices. Portable devices are usually used in various places, such as railway stations, long-distance bus stations, airports or subway stations. For security reasons, portable devices cannot be connected to the intranet where the database is located in these places, so the database of portable devices can usually only be copied from a USB flash drive or other third-party storage device. This method is inconvenient to use, and there is a lag in the update of the database. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a base library synchronization method, device and electronic system to alleviate the above-mentioned problems, simplify the update operation of portable devices, and facilitate promotion and implementation.
[0004] In a first aspect, an embodiment of the present invention provides a base database synchronization method, which is applied to a synchronization server set in an external network, and the method includes: receiving a first Oplog file sent by a gateway; wherein the gateway is a network switch used to isolate an intranet and an external network, and the above-mentioned first Oplog file is a file generated by an update operation of a business server in the intranet on a first base database set in the intranet; applying the above-mentioned first Oplog file to update a second base database set in the external network; and in response to a base database synchronization request of a portable device, updating a third base database set on the portable device based on the updated second base database set.
[0005] In combination with the first aspect, an embodiment of the present invention provides a first possible implementation method of the first aspect, wherein the url field of the above-mentioned first Oplog file is the base64 encoding of the target image modified or added by the business server; the step of applying the above-mentioned first Oplog file to update the second base library set in the external network includes: parsing the first Oplog file to obtain the target image; determining whether the target image is a newly added image according to the identifier of the target image; if so, adding the target image to the second base library set in the external network; if not, applying the target image to replace the image corresponding to the identifier in the second base library set.
[0006] In combination with the first possible implementation of the first aspect, an embodiment of the present invention provides a second possible implementation of the first aspect, wherein the step of parsing the first Oplog file to obtain the target image includes: parsing the first Oplog file through the MongoShake service to obtain the base64 code in the url field of the first Oplog file; and generating the target image based on the base64 code.
[0007] In combination with the first aspect, an embodiment of the present invention provides a third possible implementation method of the first aspect, wherein the above-mentioned base library synchronization request carries the base library list information corresponding to the third base library set on the portable device; the step of updating the third base library set on the portable device based on the updated second base library set includes: determining the target base library corresponding to the portable device according to business needs; checking whether the base library identifier of the target base library is included in the base library list information; if so, updating the target base library on the portable device based on the picture sets in the respective target base libraries on the portable device and the synchronization server; if not, sending the feature information corresponding to the target base library or each picture in the target base library to the portable device, so as to add the feature information corresponding to the target base library or each picture in the target base library to the third base library set.
[0008] In combination with the third possible implementation of the first aspect, an embodiment of the present invention provides a fourth possible implementation of the first aspect, wherein the step of updating the target base library on the portable device based on the picture sets in the respective target base libraries on the portable device and the synchronization server includes: comparing whether the number of pictures in the picture sets in the respective target base libraries on the portable device and the synchronization server are equal; if not, sending the base library identifier of the target base library on the synchronization server and the picture identifier set of the pictures in the target base library on the synchronization server to the portable device; receiving the picture identifier set to be added returned by the portable device based on the base library identifier and the picture identifier set; searching for the picture identifier set to be added corresponding to the picture identifier set to be added in the target base library of the synchronization server; sending the found picture identifier set to be added or the feature information of each picture in the picture identifier set to be added to the portable device, so as to add the picture identifier set to be added or the feature information of each picture in the picture identifier set to be added in the target base library of the portable device.
[0009] In combination with the first aspect, an embodiment of the present invention provides a fifth possible implementation of the first aspect, wherein the method also includes: if picture update information sent by a portable device is received, parsing the newly added picture and the updated base library identifier corresponding to the newly added picture from the picture update information, and updating the first base library corresponding to the updated base library identifier of the second base library set based on the updated picture; generating a second Oplog file based on the updated first base library, and sending the second Oplog file to the business server through the gateway to update the base library corresponding to the updated base library identifier in the first base library set.
[0010] In combination with the fifth possible implementation of the first aspect, an embodiment of the present invention provides a sixth possible implementation of the first aspect, wherein the step of generating a second Oplog file based on the updated first base library includes: generating a base64 code based on the updated image in the updated first base library, using the base64 code as the content of the url field, generating a second Oplog file, and the second Oplog file includes the url field.
[0011] In combination with the first aspect, an embodiment of the present invention provides a seventh possible implementation of the first aspect, wherein the method also includes: if picture deletion information sent by a portable device is received, parsing a deleted picture identifier and a deleted base library identifier corresponding to the deleted picture identifier from the picture deletion information, deleting the picture corresponding to the deleted picture identifier in the second base library corresponding to the deleted base library identifier of the second base library set; generating a third Oplog file based on the deleted second base library, and sending the third Oplog file to the business server through the gateway to delete the picture corresponding to the above-mentioned deleted picture identifier in the base library corresponding to the deleted base library identifier in the first base library set.
[0012] In combination with the first aspect, an embodiment of the present invention provides an eighth possible implementation of the first aspect, wherein the operating system of the synchronization server is different from the operating system of the portable device, and the synchronization server and the portable device are communicatively connected via ICE technology.
[0013] In the second aspect, an embodiment of the present invention also provides a base database synchronization method, which is applied to a portable device set in an external network, and the method includes: sending a base database synchronization request to a synchronization server; wherein the synchronization server is set in the external network, and a second base database set is stored in the external network, and the base databases in the second base database set are synchronized with the base databases in the first base database set of a business server in the intranet; receiving picture update information returned by the synchronization server based on the base database synchronization request and the second base database set; and updating the third base database set on the portable device based on the picture update information.
[0014] In combination with the second aspect, an embodiment of the present invention provides a first possible implementation of the second aspect, wherein the above-mentioned base library synchronization request carries base library list information corresponding to the third base library set on the portable device; the step of receiving the picture update information returned by the synchronization server based on the base library synchronization request and the second base library set includes: receiving the base library identifier of the target base library and the picture identifier set of the pictures in the target base library returned by the synchronization server based on the base library synchronization request and the second base library set; the base library identifier is included in the base library list information; determining the picture identifier set to be added based on the base library identifier and the picture identifier set; returning the picture identifier set to be added to the synchronization server; receiving the feature information of the picture set to be added corresponding to the picture identifier set to be added sent by the synchronization server or each picture in the picture set to be added; adding the feature information of the picture set to be added or each picture in the picture set to be added in the target base library of the base library identifier of the portable device.
[0015] In combination with the second aspect, an embodiment of the present invention provides a second possible implementation method of the second aspect, wherein the above-mentioned base library synchronization request carries the base library list information corresponding to the third base library set on the portable device; the step of receiving the picture update information returned by the synchronization server based on the base library synchronization request and the second base library set includes: receiving the feature information corresponding to the target base library or each picture in the target base library returned by the synchronization server based on the base library synchronization request and the second base library set; the base library identifier of the target base library is not included in the base library list information; and adding the feature information corresponding to the target base library or each picture in the target base library to the third base library set on the portable device.
[0016] In combination with the second aspect, an embodiment of the present invention provides a third possible implementation method of the second aspect, wherein the method further includes: if there is an image update, sending image update information to the synchronization server, so that the synchronization server updates the second base database set based on the image update information; wherein the image update information carries the updated image and an updated base database identifier corresponding to the updated image; if there is an image deletion, sending image deletion information to the synchronization server, so that the synchronization server updates the second base database set based on the image deletion information; wherein the image deletion information carries a deleted image identifier and a deleted base database identifier corresponding to the deleted image identifier.
[0017] In a third aspect, an embodiment of the present invention further provides a base database synchronization method, which is applied to a business server set in an intranet, and the method includes: generating a first Oplog file based on an update operation of a first base database set of the business server;
[0018] A first Oplog file is sent to a synchronization server through a gateway, so that the synchronization server applies the first Oplog file to update a second base database set in an external network, and responds to a base database synchronization request of a portable device to update a third base database set on the portable device based on the updated second base database set; wherein the above-mentioned gateway is a network switch for isolating an intranet and an external network, and the above-mentioned synchronization server is arranged in the external network.
[0019] In combination with the third aspect, an embodiment of the present invention provides a first possible implementation of the third aspect, wherein the step of generating a first Oplog file based on the update operation of the first base database set of the business server includes: when a target image is added or modified, generating a base64 encoding of the target image; using the base64 encoding as the content of the url field to generate a first Oplog file, and the first Oplog file includes a url field.
[0020] In combination with the third aspect, an embodiment of the present invention provides a second possible implementation of the third aspect, wherein the method also includes: receiving a second Oplog file sent by the synchronization server through a gateway; the second Oplog file is generated by the synchronization server based on an update picture of a portable device; and updating the target base library of the first base library set based on the second Oplog file.
[0021] In combination with the third aspect, an embodiment of the present invention provides a third possible implementation method of the third aspect, wherein the method also includes: receiving a third Oplog file sent by the synchronization server through a gateway; the third Oplog file is generated by the synchronization server based on deleted pictures of a portable device; and deleting the above-mentioned deleted pictures in the target base library of the first base library set based on the third Oplog file.
[0022] In a fourth aspect, an embodiment of the present invention further provides a base database synchronization device, which is applied to a synchronization server arranged in an external network, and the device includes: a first receiving module, used to receive a first Oplog file sent by a gateway; wherein the gateway is a network switch used to isolate an intranet and an external network, and the first Oplog file is a file generated by a business server in the intranet performing an update operation on a first base database set in the intranet; a first update module, used to apply the first Oplog file to update a second base database set in the external network; and a second update module, used to respond to a base database synchronization request of a portable device, and update a third base database set on the portable device based on the updated second base database set.
[0023] In the fifth aspect, an embodiment of the present invention further provides a base database synchronization device, which is applied to a portable device set up in an external network, and the device includes: a request sending module, used to send a base database synchronization request to a synchronization server; wherein the synchronization server is set up in the external network, and a second base database set is stored in the external network, and the base databases in the second base database set are synchronized with the base databases in the first base database set of the business server in the intranet; a second receiving module, used to receive picture update information returned by the synchronization server based on the base database synchronization request and the second base database set; a third update module, used to update the third base database set on the portable device based on the picture update information.
[0024] In the sixth aspect, an embodiment of the present invention further provides a base database synchronization device, which is applied to a business server set in an intranet, and the device includes: a file generation module, which is used to generate a first Oplog file based on an update operation of a first base database set of the business server; a file sending module, which is used to send the first Oplog file to the synchronization server through a gateway, so that the synchronization server applies the first Oplog file to update the second base database set in the external network, and responds to the base database synchronization request of the portable device, and updates the third base database set on the portable device based on the updated second base database set; wherein the gateway is a network switch used to isolate the intranet and the external network, and the synchronization server is set in the external network.
[0025] In the seventh aspect, an embodiment of the present invention further provides an electronic system, which includes: a portable device, a synchronization server and a business server; wherein the business server includes a first storage device for storing a first base database set and a first computer program, and a first processing device; the synchronization server includes a second storage device for storing a second base database set and a second computer program, and a second processing device; the portable device includes a third storage device for storing a third base database set and a third computer program, and a third processing device; the first computer program executes the base database synchronization method described in the third aspect when being run by the first processing device; the second computer program executes the base database synchronization method described in the first aspect when being run by the second processing device; and the third computer program executes the base database synchronization method described in the second aspect when being run by the third processing device.
[0026] In an eighth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processing device, the steps of the above-mentioned base database synchronization method are executed.
[0027] The embodiments of the present invention bring the following beneficial effects:
[0028] The embodiment of the present invention provides a base database synchronization method, device and electronic system. A synchronization server arranged in an external network receives a first Oplog file sent by a business server through a gateway, and the first Oplog file is a file generated by the business server based on an update operation of a first base database set in an intranet. The synchronization server applies the first Oplog file to update a second base database set in the external network, thereby realizing timely synchronization of the first base database set in the intranet and the second base database set in the external network. In addition, the synchronization server responds to a base database synchronization request of a portable device, and then updates a third base database set on the portable device based on the updated second base database set, thereby realizing synchronization of the third base database set in the external network and the second base database set, which is equivalent to realizing synchronization between the third base database set on the portable device and the first base database set on the intranet business server. This synchronization method does not require the portable device to be configured with additional storage hardware (such as a USB flash drive, etc.) and a third-party storage device. The base database can be quickly synchronized by sending a synchronization request by the portable device, thereby alleviating the base database update lag problem of the portable device, simplifying the update operation of the portable device, and facilitating promotion and implementation.
[0029] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0030] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 A schematic diagram of the structure of an electronic system provided by an embodiment of the present invention;
[0033] Figure 2 A flowchart of a base database synchronization method provided by an embodiment of the present invention;
[0034] Figure 3 A schematic diagram of a base database synchronization application scenario provided by an embodiment of the present invention;
[0035] Figure 4 A schematic diagram of a registration method provided by an embodiment of the present invention;
[0036] Figure 5 A flowchart of another base database synchronization method provided by an embodiment of the present invention;
[0037] Figure 6 A schematic diagram of transmission of a first Oplog file provided by an embodiment of the present invention;
[0038] Figure 7 A flowchart of another base database synchronization method provided by an embodiment of the present invention;
[0039] Figure 8 A schematic diagram of a base database synchronization method provided by an embodiment of the present invention;
[0040] Fig. 9 A flowchart of another base database synchronization method provided by an embodiment of the present invention;
[0041] Fig.10 A flowchart of another base database synchronization method provided by an embodiment of the present invention;
[0042] Fig.11 A flowchart of another base database synchronization method provided by an embodiment of the present invention;
[0043] Fig.12 A schematic diagram of a base storage synchronization device provided by an embodiment of the present invention;
[0044] Fig.13 A schematic diagram of another base storage synchronization device provided by an embodiment of the present invention;
[0045] Fig.14 A schematic diagram of another base storage synchronization device provided by an embodiment of the present invention;
[0046] Fig.15 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] In practical applications, since the base database of portable devices is usually copied from a USB flash drive or other third-party storage device, the portable device is inconvenient to use and there is a lag in updating the base database. Similarly, the base database of a portable device may temporarily add a base database picture during field use, and it is necessary to search for the target corresponding to the base database picture in the image captured by the camera associated with the portable device, and synchronize the base database picture added in the portable device to the business system of the intranet, so as to conduct a large-scale search through the business system in the images captured by the camera associated with the business system (the number of cameras associated in the business system is usually more than the number of cameras associated with the portable device). Therefore, there is an urgent need for a device that can synchronize the base database portrait data of the business system and the base database of the portable device in real-time and bidirectional manner.
[0049] Based on this, the embodiments of the present invention provide a base database synchronization method, device and electronic system, which realize the base database synchronization between the business system and the portable device through the synchronization server, alleviate the problem of delayed base database updates of the portable device, simplify the update operation of the portable device, and facilitate promotion and implementation.
[0050] To facilitate understanding of this embodiment, a base database synchronization method disclosed in an embodiment of the present invention is first introduced in detail.
[0051] First, refer to Figure 1 The electronic system shown is a schematic diagram of the structure of the electronic system. The electronic system can be used to implement the base library synchronization method, device and electronic system of the embodiment of the present invention.
[0052] like Figure 1 The structure diagram of an electronic system shown in FIG. 1 includes a portable device 30 , a synchronization server 20 and a business server 10 .
[0053] The business server 10 includes a first storage device 101 for storing a first base library set and a first computer program, and a first processing device 102 .
[0054] The synchronization server 20 comprises a second storage device 201 for storing a second base library set and a second computer program, and a second processing device 202 .
[0055] The portable device 30 comprises a third storage device 301 for storing a third base library set and a third computer program, and a third processing device 302 .
[0056] In addition to storage devices and processing devices, the business server 10, synchronization server 20, and portable device 30 include: one or more first input and output devices 103 and one or more first image acquisition devices 104, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown). The synchronization server 20 also includes: one or more second input and output devices 203; the portable device 30 includes: one or more third input and output devices 303 and one or more third image acquisition devices 304.
[0057] It should be noted that Figure 1 The components and structures of the electronic system shown are merely exemplary and non-limiting. The electronic system may also have other components and structures as required.
[0058] The above-mentioned first processing device 102, second processing device 202, and third processing device 302 can all be one or more processors. The processor can be a server, an intelligent terminal, or a device or apparatus including a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities. It can process data of other components in the electronic system and can also control other components in the electronic system to perform the function of base library synchronization.
[0059] The first storage device 101, the second storage device 201 and the third storage device 301 may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processing device corresponding to the storage device may run the program instructions to implement the client functions (implemented by the processing device) and / or other desired functions in the following embodiments of the present invention. Various applications and various data, such as various data used and / or generated by the application, may also be stored in the computer-readable storage medium. For example: when the first computer program is run by the first processing device, it executes the bottom database synchronization method on the service server 10 side in the following embodiments of the present invention; when the second computer program is run by the second processing device, it executes the bottom database synchronization method on the synchronization server side in the following embodiments of the present invention; when the third computer program is run by the third processing device, it executes the bottom database synchronization method on the portable device side in the following embodiments of the present invention.
[0060] The above-mentioned first input and output device 103, second input and output device 203 and third input and output device 303 can all be input components and output components. The input component can be a device used by a user to input instructions, and can include one or more of a keyboard, a mouse, a microphone and a touch screen, etc., and can also be a data input interface.
[0061] The output component may include one or more of a display, a speaker, etc., or may be a data output interface for outputting various information (eg, images or sounds) to the outside (eg, a user).
[0062] The first image acquisition device 104 and the third image acquisition device 304 can acquire the base library images and the images to be detected, and store the acquired images in corresponding storage devices for use by other components.
[0063] There are multiple portable devices 30 in the above electronic system, and the multiple portable devices 30 can jointly maintain the base database set on the business server 10. Of course, in addition to the business server 10, the synchronization server 20, and the portable devices 30, the above electronic system can also include network devices such as gateways ( Figure 1 (not shown) to realize information transmission to the corresponding device via the network.
[0064] Exemplarily, the components in the base database synchronization method, device, and electronic system for implementing the embodiments of the present invention can be integrated or dispersed, such as the processing device, storage device, input and output device on each device of the business server 10, synchronization server 20, and portable device 30 can be integrated, and the image acquisition device is set at a specified position where the image can be acquired. When the components in the above-mentioned business server 10, synchronization server 20, and portable device 30 are integrated, the business server 10, synchronization server 20, and portable device 30 can be implemented as smart terminals such as cameras, smart phones, tablet computers, computers, and vehicle-mounted terminals.
[0065] The embodiment of the present invention provides a method for synchronizing a base database. The execution subject of the method is a synchronization server set up in an external network. The synchronization server is connected to the network gate (also called a gateway) of the business server in communication. Figure 2 The flowchart of the bottom database synchronization method shown in FIG. 1 includes the following steps:
[0066] Step S202, receiving a first Oplog file sent by a gateway; wherein the gateway is a network gate for isolating an intranet and an extranet, and the first Oplog file is a file generated by a business server in the intranet performing an update operation on a first base database set in the intranet.
[0067] The first Oplog file is a log file, which is generated based on the above-mentioned first base library set update operation. Therefore, the file contains relevant information of the pictures corresponding to the update operation of the first base library set, such as the encoding information of the newly added pictures or the encoding information of the modified pictures.
[0068] like Figure 3 In the schematic diagram of the base database synchronization application scenario shown, the business server of the intranet is connected to the synchronization server of the external network through the gateway, and the portable devices A, B and C of the external network are connected to the synchronization server. The portable devices A, B and C are mobile portable devices distributed in various places. In actual applications, the number of portable devices can be set according to the actual application scenario, and the embodiment of the present invention does not limit this.
[0069] For ease of description, in the embodiment of the present invention, the base library set on the service server side is referred to as the first base library set, the base library set in the external network is referred to as the second base library set, and the base library set on all portable devices is referred to as the third base library set. The first base library set, the second base library set, and the third base library set in the embodiment of the present invention may include multiple base libraries of different types, for example: the base library of a drug-related picture set is a drug-related base library, and the base library of a gambling-related picture set is a gambling-related base library. Pictures in one type of base library may have some overlap with pictures in other types of base libraries, or there may be no overlap.
[0070] When the business server generates the first Oplog file based on the update operation of the first base database set in the intranet, the business server sends the first Oplog file to the synchronization server through the gateway, that is, the synchronization server receives the first Oplog file sent by the gateway.
[0071] Step S204: Apply the first Oplog file to update the second base database set in the external network.
[0072] After the above-mentioned synchronization server receives the first Oplog file, it can parse the first Oplog file to obtain the image information corresponding to the above-mentioned update operation, and then update the second base database set in the external network based on the image information. At this time, the updated second base database set and the base database of the corresponding first base database set in the business server are synchronized in quasi-real time.
[0073] Step S206 , in response to the base library synchronization request of the portable device, updating the third base library set on the portable device based on the updated second base library set.
[0074] Portable devices are removable devices. In actual applications, portable devices are not in a continuously powered-on state, but are powered on only when needed. Each time they are powered on, the portable devices will send a base database synchronization request to the synchronization server to update their third base database set.
[0075] In actual applications, the operating system of the synchronization server is different from that of the portable device. Since the portable device is generally written in Python and deployed on the Windows operating system, while the synchronization server is written in Java and deployed on the Linux operating system, the portable device and the synchronization server cannot achieve communication connection. Based on this, considering that ICE (Interactive Connectivity Establishment) is an all-powerful RPC (Remote Procedure Call Protocol) framework that can support languages such as C++, C#, Java, JavaScript and Python, in the embodiment of the present invention, the portable device and the synchronization server achieve communication connection through ICE technology. Specifically, the communication interface between each portable device and the synchronization server is written into the Service.ice file, and the corresponding ICE code is generated according to the deployment platform of the portable device and the synchronization server, and is respectively embedded in the communication service of the portable device and the communication server of the synchronization server, so that when the portable device is turned on, the ICE function of the portable device is started, and the ICE function is set with the interface address of the synchronization server, so as to achieve communication between the portable device and the synchronization server.
[0076] When the synchronization server receives a base library synchronization request from the portable device, the synchronization server updates the third base library set on the portable device based on the updated second base library set, so that the base library information of the updated third base library set in the portable device and the updated second base library set can be synchronized in time. Since the updated second base library set and the base library information of the corresponding first base library set in the business server are synchronized in quasi real time, the base library information of the updated third base library set in the portable device and the corresponding updated first base library set in the business server can be synchronized through the synchronization server.
[0077] In the above-mentioned base database synchronization method provided by the embodiment of the present invention, a synchronization server arranged in the external network receives a first Oplog file sent by a business server through a gateway, and the first Oplog file is a file generated by the business server based on an update operation of a first base database set in the intranet, and the synchronization server applies the first Oplog file to update a second base database set in the external network, thereby realizing timely synchronization of the first base database set in the intranet and the second base database set in the external network, and the synchronization server responds to a base database synchronization request of the portable device, and then updates a third base database set on the portable device based on the updated second base database set, thereby realizing synchronization of the third base database set in the external network and the second base database set, which is equivalent to realizing synchronization between the third base database set on the portable device and the first base database set on the intranet business server. This synchronization method does not require the portable device to be configured with additional storage hardware (such as a USB flash drive, etc.) and a third-party storage device, and the base database can be quickly synchronized by sending a synchronization request by the portable device, thereby alleviating the base database update lag problem of the portable device, simplifying the update operation of the portable device, and facilitating promotion and implementation.
[0078] In actual applications, portable devices distributed in various places are also registered in the synchronization server through ICE technology. Specifically, Figure 4 As shown in the registration method diagram, each portable device sends registration information to the synchronization server through ICE technology. The registration information includes but is not limited to the IP (Internet Protocol) of each portable device, the port (the interface for communication with the synchronization server), the base library list, the number of base library images, and the model version information of the application algorithm, so that the synchronization server completes the registration of the portable device according to the received registration information. In particular, if a portable device has completed registration, the synchronization server will also update the received registration information to the database so that the user can query the registration information of a portable device in the synchronization server.
[0079] It should be noted that since the operator may update the base library list when the portable device is disconnected from the network, the portable device needs to send the base library list to the synchronization server each time it is turned on. Here, the base library list is the base library list in the third base library set.
[0080] exist Figure 2 Based on the above, the embodiment of the present invention also provides another base database synchronization method, the execution subject is the synchronization server, and the method focuses on describing the specific process of the synchronization server applying the first Oplog file to update the second base database set in the external network. Among them, the url field of the first Oplog file is the base64 encoding of the target image modified or added by the business server, such as Figure 5 As shown, the method comprises the following steps:
[0081] Step S502, receiving a first Oplog file sent by a gateway; wherein the gateway is a network gate for isolating an intranet from an extranet, and the first Oplog file is a file generated by a business server in the intranet performing an update operation on a first base database set in the intranet.
[0082] Step S504, parse the first Oplog file to obtain the target image.
[0083] Specifically, a Mongodb database is provided in both the business server and the synchronization server, wherein the base database in the business server is stored in the Mongodb database, and can be directly accessed through the url (uniform resource locator) field of the image information in the Mongodb database. In practical applications, the images in the Mongodb database can be grouped and stored in data sets to form base databases of corresponding types for each collection. Each image stored in the Mongodb database can also be provided with a unique identifier, which can be represented by base64 encoding.
[0084] like Figure 6 The transmission diagram of the first Oplog file shown in the figure shows that when the business server updates the first base library set, such as modifying or adding a target image, the above update operation will be recorded in the Oplog log and saved in the ftp (file transfer protocol) directory of the business server. The business server parses the above Oplog log through the MongoShake service, obtains the URL of the target image, and downloads the target image according to the URL, changes the downloaded target image to the corresponding base64 code, replaces the URL of the target image in the Oplog log with the base64 code, obtains the first Oplog file, and sends the first Oplog file to the ftp directory of the synchronization server through the gateway.
[0085] After receiving the first Oplog file, the synchronization server parses the first Oplog file through the MongoShake service, obtains the base64 code in the url field of the first Oplog file, and generates a target image based on the base64 code.
[0086] Among them, the MongoShake service is a general platform service written in golang language. It reads the Oplog operation log of the Mongodb database to copy the data stored in Mongodb, so as to achieve specific needs by parsing the operation log. Therefore, the synchronization server parses the operation log in the first Oplog file through the MongoShake service, and can obtain the base64 code in the url field of the first Oplog file, so that the target image can be generated according to the base64 code.
[0087] Step S506, determining whether the target image is a newly added image according to the identifier of the target image. If yes, execute step S508; if not, execute step S510.
[0088] The identification of the target image in this embodiment may include two parts: a base database ID and a picture ID. For example, the first 16 bits of the base64 encoding in the url field are used as the identification of the target image, the first to eighth bits of the first 16 bits are encoded as the base database ID, and the eighth to sixteenth bits are encoded as the picture ID.
[0089] After the above-mentioned synchronization server obtains the target image, it can determine whether the target image is a newly added image based on the identifier of the target image. Specifically, it searches the target base library corresponding to the identifier of the target image in the second base library set, and checks whether the image ID of the target image exists in the target base library. If it exists, it means that it is not a newly added image, but a modification based on the original image; if it does not exist, it means that it is a newly added image.
[0090] Of course, other image identification methods can also be used to implement it. For example, the target base library ID and the image ID are carried in other fields other than the url field of the first Oplog file, and the base64 code in the url field is only the image code. Alternatively, if the target base library ID is carried in other fields other than the url field of the first Oplog file, the base64 code in the url field can only include the image ID, not the base library ID.
[0091] Step S508, adding the target image to the second base library set on the external network.
[0092] At this time, since the target image is a newly added image, the synchronization server will add the target image to the corresponding base library of the second base library set, so that the updated second base library set and the updated first base library set in the business server can be synchronized in quasi-real time. Quasi-real time here means that there is a network gate between the synchronization server and the business server, so there will be a certain delay in data transmission through the network gate, but the base library information of the updated second base library set and the updated first base library set in the business server will be consistent in the end.
[0093] Step S510: Use the target image to replace the image corresponding to the identifier in the second base library set.
[0094] When the target image is a modification of the original image by the business server, at this time, the synchronization server will apply the target image to replace the corresponding image identified in the second base library set, thereby achieving quasi-real-time synchronization between the updated second base library set and the updated first base library set in the business server.
[0095] Step S512: in response to the base library synchronization request of the portable device, updating the third base library set on the portable device based on the updated second base library set.
[0096] The above method carries the base64 encoding of the target image in the url field of the first Oplog file, so that the synchronization server can generate the target image based on the base64 encoding, and then complete the update of the target image in the second base library set, so that the second base library set can be synchronized with the first base library set in a timely manner, thereby ensuring the timeliness and accuracy of the subsequent base library synchronization operations of the portable device.
[0097] exist Figure 2 Based on the above, the embodiment of the present invention also provides another base database synchronization method, the execution subject is a synchronization server, and the method focuses on the specific process of updating the third base database set on the portable device based on the updated second base database set. Figure 7 As shown, the method comprises the following steps:
[0098] Step S702, receiving a first Oplog file sent by a gateway; wherein the gateway is a network gate for isolating an intranet from an extranet, and the first Oplog file is a file generated by a business server in the intranet performing an update operation on a first base database set in the intranet.
[0099] Step S704: Apply the first Oplog file to update the second base database set in the external network.
[0100] The above steps S702 to S704 may refer to steps S202 to S204, and the embodiment of the present invention will not be described in detail here.
[0101] Step S706, in response to the base database synchronization request of the portable device, determine the target base database corresponding to the portable device according to the business demand; wherein the base database synchronization request carries base database list information corresponding to the third base database set on the portable device.
[0102] Specifically, when the portable device is connected to the synchronization server through the ICE technology, the default synchronization server receives the base library synchronization request of the portable device, and the base library synchronization request carries the base library list information corresponding to the third base library set on the portable device, where the base library list information includes the base library list identifier and the number of base library pictures, so that the synchronization server determines the target base library corresponding to the portable device according to the business needs. For example, portable device A sends a base library synchronization request to the synchronization server, and the business need of portable device A is a collection of pictures of drug-related persons, then the synchronization server determines the target base library corresponding to portable device A according to the business need. It should be noted that the business need here can be set by the operator of the portable device according to the actual application scenario of the portable device.
[0103] Step S708, checking whether the above-mentioned base library list information contains the base library identifier of the target base library, if yes, executing step S710; if not, executing step S712.
[0104] After the synchronization server determines the target base library of the portable device, the synchronization server also searches for the base library list information corresponding to the third base library set on the portable device carried by the base library synchronization request to see whether the base library list information contains the identifier of the target base library. For example, assuming that the identifier of the target base library is A3, and the base library list information corresponding to the third base library set on the portable device includes base library identifiers A1 and A2, it means that the base library list information does not include the base library identifier of the target base library. If the base library list information corresponding to the third base library set on the portable device includes base library identifiers A1, A2 and A3, it means that the base library list information contains the base library identifier of the target base library.
[0105] Step S710: based on the picture sets in the respective target base libraries on the portable device and the synchronization server, the target base library on the portable device is updated.
[0106] When the base library list information corresponding to the third base library set contains the identifier of the target base library of the portable device, at this time, the synchronization server will also update the target base library in the portable server according to the picture set of the target base library in the synchronization server. Specifically, the synchronization server first compares whether the number of pictures in the picture sets in the respective target base libraries of the portable device and the synchronization server are equal; if not equal, the synchronization server sends the base library identifier of the target base library on the synchronization server and the picture identifier set of the pictures in the target base library on the synchronization server to the portable device, so as to receive the picture identifier set to be added returned by the portable device based on the base library identifier and the picture identifier set; and searches for the picture identifier set to be added corresponding to the above picture identifier set to be added in the target base library of the synchronization server; and sends the found picture identifier set to be added or the feature information of each picture in the picture identifier set to be added to the portable device, so as to add the picture identifier set to be added or the feature information of each picture in the picture identifier set to be added in the target base library of the portable device, so as to realize the timely synchronization of the target base library of the portable device and the corresponding target base library in the synchronization server.
[0107] In the above method, considering that the type of objects stored in the third base library set of the portable device can be either pictures or picture feature information, if it is picture feature information, it means that the base library in the third base library set of the portable device stores the feature information corresponding to each picture, rather than the specific picture. In this application scenario, the feature information of each picture in the picture set to be added can be sent to the portable device to achieve synchronization between the third base library set and the first base library set. If the pictures are stored in the third base library set of the portable device, the above picture set to be added can be directly sent.
[0108] Step S712: sending the target base library or the feature information corresponding to each picture in the target base library to the portable device, so as to add the target base library or the feature information corresponding to each picture in the target base library to the third base library set.
[0109] If the target base library does not have an identifier in the base library list information, it means that the target base library does not exist in the third base library set of the portable device. At this time, the synchronization server sends the target base library or the feature information corresponding to each picture in the target base library to the portable device, so that the portable device adds the feature information corresponding to the target base library or each picture in the target base library to the third base library set, thereby achieving timely synchronization between the target base library of the portable device and the corresponding target base library in the synchronization server. Among them, sending the feature information corresponding to each picture in the target base library is also determined based on the type of objects stored in the third base library set of the portable device. If the type of objects stored in the third base library set is pictures, the target base library is sent. If the type of objects stored in the third base library set is picture feature information, the feature information corresponding to each picture in the target base library is sent.
[0110] The above-mentioned synchronization method uses the base library list information corresponding to the third base library set on the portable device as a benchmark to determine whether the target base library exists in the third base library set, and then specifically sends the target base library or the picture set that needs to be updated in the target base library. It can reduce network resource consumption as much as possible and quickly complete the synchronization operation of the third base library set. On the basis of simple and easy operation, it further improves the synchronization efficiency of the base library.
[0111] In one possible implementation, when the base library of the portable device is updated (for example, adding or deleting pictures), a synchronization operation is also required. Taking the addition of pictures by a portable device as an example, when the portable device adds pictures, it sends picture update information to the synchronization server, and the picture update information includes the updated picture and the updated base library identifier corresponding to the updated picture. After the synchronization server receives the picture update information sent by the portable device, it parses the updated picture and the updated base library identifier corresponding to the updated picture from the picture update information, and adds the updated picture to the first base library corresponding to the updated base library identifier of the second base library set; wherein the updated base library identifier is the identifier of the base library where the newly added picture is located, and the synchronization server searches for the corresponding first base library in the second base library set according to the updated base library identifier, and adds the updated picture to the first base library to obtain an updated second base library set.
[0112] In the above update operation, the synchronization server also generates a second Oplog file based on the added first base library, and sends the second Oplog file to the business server through the gateway to add the above updated image to the base library corresponding to the updated base library identifier in the first base library set.
[0113] The second Oplog file contains a url field. Specifically, the synchronization server generates a base64 code based on the updated image in the first base library after the addition, and uses the base64 code as the content of the url field, thereby generating the second Oplog file. After receiving the second Oplog file, the business server also parses the second Oplog file through the MongoShake service to obtain the base64 code in the url field in the second Oplog file; and generates an updated image based on the base64 code, thereby adding the updated image to the base library corresponding to the updated base library identifier in the first base library set, and realizing quasi-real-time synchronization of the portable device with the base library corresponding to the updated base library identifier of the synchronization server and the business server.
[0114] Similar to the business server, the synchronization server can also read the Oplog generated by updating the second base library set through the MongoShake service, obtain the URL of the newly added image recorded in the Oplog log, and download the newly added image according to the URL, change the downloaded newly added image to the corresponding base64 encoding, replace the above URL, obtain the second Oplog file, and send the second Oplog file to the ftp target of the business server through the gateway, so that the business server can parse the above second Oplog file through the MongoShake service to achieve quasi-real-time synchronization of the base libraries of the business server and the synchronization server.
[0115] In another possible implementation, when the base database of the portable device deletes a picture, at this time, after the synchronization server receives the picture deletion information sent by the portable device, it parses the deleted picture identifier and the deleted base database identifier corresponding to the deleted picture identifier from the picture deletion information, and deletes the picture corresponding to the deleted picture identifier in the second base database corresponding to the deleted base database identifier of the second base database set. After the above deletion operation is completed, the synchronization server also generates a third Oplog file based on the deleted second base database, and sends the third Oplog file to the business server through the gateway, so that the business server parses the third Oplog file through the MongoShake service to delete the picture corresponding to the above-mentioned deleted picture identifier from the base database corresponding to the deleted base database identifier in the first base database set, thereby realizing timely synchronization of the base database corresponding to the updated base database identifier of the portable device and the synchronization server and the business server.
[0116] In actual applications, the synchronization server can communicate with multiple portable devices through ICE technology, and support multiple portable devices to send base library information, image information or feature values (i.e., the above-mentioned feature information), etc. If it is a feature value, the image information can be converted into the model version information of the application algorithm of the corresponding portable device, and the model version information of the application algorithm can be reported to the synchronization server.
[0117] For ease of understanding, here we take the storage object in the third base library set on the portable device as a picture as an example. Figure 8 The synchronization method schematic diagram shown in FIG. 1 includes the following steps:
[0118] (1) After portable device A, portable device B and portable device C are turned on, they send synchronization requests to the synchronization server respectively. The base library synchronization requests sent by portable device A and portable device B both carry base library list information, where the base library list information includes a base library list identifier and the number of base library images.
[0119] Assume that the base library list information A of portable device A is base library A2, and the number of base library images of base library A2 is 200. Assume that the base library list information B of portable device B is base library A3, and the number of base library images of base library A3 is 300. The base library list information C of portable device C is base library A1, and the number of base library images of base library A1 is 100.
[0120] (2) After receiving the synchronization requests from portable device A, portable device B and portable device C, the synchronization server parses the above-mentioned base library list information A, the above-mentioned base library list information B and the base library list information C.
[0121] (3) According to the business needs of portable device A, the target base library of portable device A is determined to be base library A2; according to the business needs of portable device B, the target base library of portable device B is determined to be base library A3; according to the business needs of portable device C, the target base library of portable device C is determined to be A1 and base library A3.
[0122] For portable device A, the synchronization server determines that the base library list information A contains the base library identifier of the target base library (i.e., base library A2), and then further determines whether the image collection in the base library A2 of the synchronization server and the number of images in the base library A2 in the base library list information A are the same. Assuming that the number of base library images in the base library A2 of the synchronization server is also 200, it means that the two are the same. From the same number of base library images, it can be inferred that the base library A2 of the portable device should be the same as the base library A2 on the synchronization server side, and there is no need to perform subsequent synchronization operations.
[0123] For portable device B, the synchronization server determines that the base library list information B contains the base library identifier of the target base library (i.e., base library A3), and then further determines whether the number of pictures in the base library A3 of the synchronization server is the same as the number of pictures in the base library A3 in the base library list information B. Assuming that the number of base library pictures in the base library A3 of the synchronization server is 350, it means that the picture set of base library A3 in the synchronization server is different from the picture set of base library A3 in portable device B, and synchronization operation of base library A3 is required.
[0124] For portable device C, the synchronization server determines that the base library list information C contains base library A1 in the target base library, but does not contain base library A3, and then further determines whether the number of pictures in base library A1 of the synchronization server is the same as the number of pictures in base library A1 in base library list information C. Assuming that the number of base library pictures in base library A1 of the synchronization server is also 100, it means that the picture set of base library A1 in the synchronization server is the same as the picture set of base library A1 in portable device C, and there is no need to synchronize base library A1. Because base library list information C does not contain base library A3, and base library A3 is the target base library of portable device C, the synchronization server needs to send base library A3 to portable device C.
[0125] (4) The synchronization server sends the base library A3 identifier and the picture ID set M of all base library pictures of base library A3 to portable device B. The synchronization server sends all base library pictures of base library A3 to portable device C.
[0126] (5) After receiving the identifier of base A3 and set M, portable device B searches base A3 of the device and obtains a set N of picture IDs of all base pictures in base A3 of the device. For a picture ID in sets M and N, if the picture ID ∈ N and the picture This means that the picture is in set N but not in set M, and portable device B deletes the picture with this ID. This means that the picture is in set M but not in set N. The ID of the picture is added to the set S of picture IDs to be added.
[0127] After the portable device B compares the above set M and set N, it sends the base library A3 identifier and set S to the synchronization server.
[0128] After receiving the base database A3 sent by the synchronization server, the portable device C saves the base database A3.
[0129] (6) After the synchronization server receives the base database A3 identifier and set S sent by portable device B, the synchronization server retrieves the image corresponding to the image ID contained in set S from the base database set of the synchronization server (such as the service database mongodb), obtains the image set T, and then sends the base database A3 identifier and image set T to portable device B through ICE.
[0130] (7) After receiving the identifier of the base library A3 and the picture set T, the portable device B stores the picture set T in the base library A3.
[0131] It should be noted that when the third base library set of a portable device is updated, including adding, modifying and deleting pictures, the update operation of the first base library set in the business server is implemented through the synchronization server; when the business server update operation is completed, the update operation of the remaining portable devices will also be implemented through the synchronization server, thereby ensuring timely synchronization between each portable device and the business server.
[0132] Based on the above embodiment, the embodiment of the present invention also provides another base database synchronization method, the execution subject is a portable device set in the external network. Fig. 9 As shown, the method comprises the following steps:
[0133] Step S902, sending a base database synchronization request to the synchronization server; wherein the synchronization server is set in the external network, and a second base database set is stored in the external network, and the base databases in the second base database set are synchronized with the base databases in the first base database set of the business server in the intranet.
[0134] Specifically, when the portable device is turned on, the portable device realizes communication connection with the synchronization server through ICE technology. At this time, the portable device sends a base database synchronization request to the synchronization server to update and improve the base database information in the portable device.
[0135] Step S904: receiving the picture update information returned by the synchronization server based on the base database synchronization request and the second base database set.
[0136] After the synchronization server receives the base database synchronization request from the portable device, it also generates image update information based on the base database synchronization request and the second base database set, and sends the image update information to the portable device so that the portable device updates the third base database set on the portable device based on the image update information.
[0137] Step S906: Update the third base library set on the portable device based on the picture update information.
[0138] A base database synchronization method provided by an embodiment of the present invention sends a base database synchronization request to a synchronization server through a portable device, so that the synchronization server can return image update information based on the request and the second base database set thereon. Since the base databases in the second base database set are synchronized with the base databases in the first base database set of a business server in an intranet, the third base database set on the portable device is updated based on the image update information, thereby achieving synchronization between the first base database set and the third base database set. This synchronization method does not require the configuration of an additional storage device for the portable device or the use of a third-party storage device, thereby alleviating the problem of delayed base database updates on the portable device, simplifying the update operation of the portable device, and facilitating popularization and implementation.
[0139] exist Fig. 9 Based on the above, the embodiment of the present invention also provides another base database synchronization method, the execution subject is a portable device, and the method focuses on describing the specific process of the portable device receiving the image update information returned by the synchronization server based on the base database synchronization request and the second base database set. Fig.10 As shown, the method comprises the following steps:
[0140] Step S1002, sending a base database synchronization request to the synchronization server; wherein the synchronization server is set in an external network, and a second base database set is stored in the external network, the base databases in the second base database set are synchronized with the base databases in the first base database set of the business server in the intranet, and the base database synchronization request carries the base database list information corresponding to the third base database set on the portable device.
[0141] Step S1004, receiving the target base database identifier and the picture identifier set of the pictures in the target base database returned by the synchronization server based on the base database synchronization request and the second base database set; in this embodiment, the base database identifier of the target base database is included in the above base database list information.
[0142] Specifically, after receiving the base database synchronization request, the synchronization server first determines the target base database corresponding to the portable device according to business needs, and then determines the base database list information corresponding to the third base database set on the portable device carried by the base database synchronization request, and searches whether the base database list information contains the identifier of the above-mentioned target base database. When the base database list information contains the identifier of the above-mentioned target base database, and the number of base database pictures in the picture set in the target base database in the synchronization server and the number of base database pictures in the picture set in the target base database in the portable device are different, the synchronization server sends the base database identifier of the target base database and the picture identifier set of the pictures in the target base database to the portable device.
[0143] In addition, if the base library identifier of the target base library is not included in the base library list information, the synchronization server will send the base library identifier of the target base library and a set of picture identifiers of the pictures in the target base library to the portable device to add the target base library to the third base library set on the portable device, thereby achieving quasi-real-time synchronization of the target base library of the portable device and the corresponding target base library in the synchronization server.
[0144] Step S1006: determining a set of picture identifiers to be added based on the above base database identifier and the picture identifier set.
[0145] The specific method for determining the set of picture identifiers to be added can refer to the description of the set S in the above embodiment, which will not be repeated here.
[0146] Step S1008: Return the set of picture identifiers to be added to the synchronization server.
[0147] Step S1010: receiving a set of pictures to be added corresponding to a set of picture identifiers to be added sent by a synchronization server.
[0148] Step S1012, adding the above-mentioned picture set to be added to the target base library identified by the base library of the portable device, and updating the third base library set on the portable device.
[0149] In one possible implementation, if there is an updated picture in the base library of the portable device, the portable device sends picture update information to the synchronization server, so that the synchronization server updates the second base library set based on the picture update information; wherein the picture update information carries the updated picture and the updated base library identifier corresponding to the updated picture. Optionally, the updated picture includes a modified picture and / or a newly added picture, and the corresponding updated base library identifier includes a modified base library identifier and / or a newly added base library identifier.
[0150] In another possible implementation, if an image is deleted from the base library of the portable device, the portable device sends image deletion information to the synchronization server so that the synchronization server updates the second base library set based on the image deletion information; wherein the image deletion information carries a deleted image identifier and a deleted base library identifier corresponding to the deleted image identifier.
[0151] After the synchronization server updates the second base database set according to the updated or deleted pictures of the portable device, it also uses the gateway to enable the first base database set of the business server to complete the corresponding update operation to achieve quasi-real-time synchronization of the base database information of the portable device and the business server.
[0152] Based on the above embodiment, the embodiment of the present invention also provides another base database synchronization method, the execution subject is a business server set up in the intranet. Fig.11 As shown, the method comprises the following steps:
[0153] Step S1102: Generate a first Oplog file based on an update operation of a first base database set of a business server.
[0154] In practical applications, business servers installed in the intranet are widely used in the field of face recognition. At the same time, they can control a large number of image acquisition devices (such as cameras) and use deep learning algorithm models to parse, extract features, compare and identify real-time data collected by cameras in key prevention and control areas such as railway stations, airports, and bus stations. Alarms are also performed. In addition, retrieval and identity confirmation in the portrait library are achieved through image search. Therefore, the first base database set of the business server is the base database source of the portable device, and it is of great practical significance to achieve quasi-real-time synchronization of the base database information of the portable device and the business server.
[0155] Step S1104, sending the first Oplog file to the synchronization server through the gateway, so that the synchronization server applies the first Oplog file to update the second base library set in the external network, and responds to the base library synchronization request of the portable device, and updates the third base library set on the portable device based on the updated second base library set; wherein the gateway is a network switch used to isolate the intranet and the external network, and the synchronization server is set in the external network.
[0156] An embodiment of the present invention provides a base database synchronization method. When an update operation is performed on a first base database set, a business server generates a first Oplog file, and sends the first Oplog file to a synchronization server through a gateway, so that the synchronization server applies the first Oplog file to update a second base database set in an external network, and responds to a base database synchronization request of a portable device, updates a third base database set on the portable device based on the updated second base database set. The base database synchronization between the business server and the portable device is achieved through the synchronization server, which alleviates the base database update lag problem of the portable device, simplifies the update operation of the portable device, and facilitates popularization and implementation.
[0157] In one possible implementation, when a target image is added or modified in the first base library set of the business server, a base64 encoding of the target image is generated, and the base64 encoding is used as the content of the url field to generate a first Oplog file, wherein the first Oplog file includes the above-mentioned url field, so that the business server parses the first Oplog file through the MongoShake service, obtains the base64 encoding in the url field in the first Oplog file, and obtains the target image based on the base64 encoding.
[0158] In one possible implementation, when the business server receives the second Oplog file sent by the synchronization server through the gateway; wherein the second Oplog file is generated by the synchronization server based on the update image of the portable device; based on the second Oplog file, the target base library of the first base library set is updated, thereby achieving quasi-real-time synchronization of the base library information of the portable device and the business server. In addition, when the business server receives the third Oplog file sent by the synchronization server through the gateway; wherein the third Oplog file is generated by the synchronization server based on the deletion image of the portable device; and based on the third Oplog file, the above-mentioned deletion image is deleted in the target base library of the first base library set, thereby achieving quasi-real-time synchronization of the base library information of the portable device and the business server.
[0159] Corresponds to Figure 2 The bottom database synchronization method shown in the embodiment of the present invention also provides a bottom database synchronization device, which is applied to a synchronization server set up in an external network. Fig.12 As shown, the device includes a first receiving module 1202, a first updating module 1204 and a second updating module 1206 connected in sequence, wherein the functions of each module are as follows:
[0160] The first receiving module 1202 is used to receive the first Oplog file sent by the gateway; wherein the gateway is a network gate used to isolate the intranet and the extranet, and the first Oplog file is a file generated by the business server in the intranet performing an update operation on the first base database set in the intranet.
[0161] The first updating module 1204 is used to apply the first Oplog file to update the second base database set in the external network.
[0162] The second updating module 1206 is used to update the third base library set on the portable device based on the updated second base library set in response to the base library synchronization request of the portable device.
[0163] An embodiment of the present invention provides a base database synchronization device, in which a synchronization server arranged in an external network receives a first Oplog file sent by a business server through a gateway, and the first Oplog file is a file generated by the business server based on an update operation of a first base database set in an internal network, and the synchronization server applies the first Oplog file to update a second base database set in the external network, thereby realizing timely synchronization of the first base database set in the internal network and the second base database set in the external network, and the synchronization server responds to a base database synchronization request of a portable device, and then updates a third base database set on the portable device based on the updated second base database set, thereby realizing synchronization of the third base database set in the external network and the second base database set, which is equivalent to realizing synchronization between the third base database set on the portable device and the first base database set on the internal network business server. This synchronization method does not require the portable device to be configured with additional storage hardware (such as a USB flash drive, etc.) and a third-party storage device, and the base database can be quickly synchronized by sending a synchronization request by the portable device, thereby alleviating the base database update lag problem of the portable device, simplifying the update operation of the portable device, and facilitating promotion and implementation.
[0164] In one possible implementation, the url field of the first Oplog file is the base64 encoding of the target image modified or added by the business server, and the first update module 1204 is also used to: parse the first Oplog file to obtain the target image; determine whether the target image is a newly added image according to the identifier of the target image; if so, add the target image to the second base library set on the external network; if not, use the target image to replace the image corresponding to the identifier in the second base library set.
[0165] In another possible implementation, the first update module 1204 is further configured to: parse the first Oplog file through the MongoShake service to obtain the base64 code in the url field of the first Oplog file; and generate a target image based on the base64 code.
[0166] In another possible implementation, the above-mentioned base library synchronization request carries the base library list information corresponding to the third base library set on the portable device, and the above-mentioned second update module 1206 is also used to: determine the target base library corresponding to the portable device according to business needs; check whether the base library list information contains the base library identifier of the target base library; if so, update the target base library on the portable device based on the picture sets in the respective target base libraries on the portable device and the synchronization server; if not, send the feature information corresponding to the target base library or each picture in the target base library to the portable device, so as to add the feature information corresponding to the target base library or each picture in the target base library in the third base library set.
[0167] In another possible implementation, the second update module 1206 is also used to: compare whether the number of pictures in the picture sets in the respective target base libraries on the portable device and the synchronization server is equal; if not, send the base library identifier of the target base library on the synchronization server and the picture identifier set of the pictures in the target base library on the synchronization server to the portable device; receive the picture identifier set to be added returned by the portable device based on the base library identifier and the picture identifier set; search for the picture set to be added corresponding to the picture identifier set to be added in the target base library of the synchronization server; send the found picture set to be added or the feature information of each picture in the picture set to be added to the portable device, so as to add the picture set to be added or the feature information of each picture in the picture set to be added in the target base library of the portable device.
[0168] In another possible implementation, the second update module 1206 is also used for: if image update information sent by a portable device is received, parsing the updated image and the updated base library identifier corresponding to the updated image from the image update information, and updating the first base library corresponding to the updated base library identifier of the second base library set based on the updated image; generating a second Oplog file based on the updated first base library, and sending the second Oplog file to the business server through the gateway to update the base library corresponding to the updated base library identifier in the first base library set.
[0169] In another possible implementation, the second update module 1206 is further used to generate a base64 code based on the updated image in the updated first base library, use the base64 code as the content of the url field, and generate a second Oplog file, wherein the second Oplog file includes the url field.
[0170] In another possible implementation, the second update module 1206 is also used for: if picture deletion information sent by a portable device is received, parsing the picture deletion identifier and the deletion base library identifier corresponding to the picture deletion identifier from the picture deletion information, deleting the picture corresponding to the deletion picture identifier in the second base library corresponding to the deletion base library identifier of the second base library set; generating a third Oplog file based on the deleted second base library, and sending the third Oplog file to the business server through the gateway to delete the picture corresponding to the deletion picture identifier in the base library corresponding to the deletion base library identifier in the first base library set.
[0171] In another possible implementation, the operating system of the synchronization server is different from the operating system of the portable device, and the synchronization server and the portable device are connected in communication via ICE technology.
[0172] Corresponds to Fig. 9 In addition to the base database synchronization method shown in , the embodiment of the present invention also provides a base database synchronization device, which is applied to a portable device set up in an external network. Fig.13 As shown, the device includes a request sending module 1302, a second receiving module 1304 and a third updating module 1306 connected in sequence, wherein the functions of each module are as follows:
[0173] The request sending module 1302 is used to send a base database synchronization request to the synchronization server; wherein the synchronization server is set in the external network, and a second base database set is stored in the external network, and the base databases in the second base database set are synchronized with the base databases in the first base database set of the business server in the internal network.
[0174] The second receiving module 1304 is used to receive the picture update information returned by the synchronization server based on the base database synchronization request and the second base database set.
[0175] The third updating module 1306 is used to update the third base library set on the portable device based on the picture update information.
[0176] In one possible implementation manner, the above-mentioned base library synchronization request carries the base library list information corresponding to the third base library set on the portable device, and the above-mentioned second receiving module 1304 is also used to: receive the base library identifier of the target base library and the picture identifier set of the pictures in the target base library returned by the synchronization server based on the base library synchronization request and the second base library set; the base library identifier is included in the base library list information; determine the picture identifier set to be added based on the base library identifier and the picture identifier set; return the picture identifier set to be added to the synchronization server; receive the picture identifier set to be added corresponding to the picture identifier set to be added sent by the synchronization server; and add the picture identifier set to be added in the target base library of the base library identifier of the portable device.
[0177] In another possible implementation, the above-mentioned base library synchronization request carries the base library list information corresponding to the third base library set on the portable device, and the above-mentioned second receiving module 1304 is also used to: receive the target base library returned by the synchronization server based on the base library synchronization request and the second base library set; the base library identifier of the target base library is not included in the base library list information; and add the target base library to the third base library set on the portable device.
[0178] In another possible implementation, the third update module 1306 is also used to: if there is an image update, send image update information to the synchronization server, so that the synchronization server updates the second base database set based on the image update information; wherein the image update information carries the updated image and the updated base database identifier corresponding to the updated image; if there is an image deletion, send image deletion information to the synchronization server, so that the synchronization server updates the second base database set based on the image deletion information; wherein the image deletion information carries the deleted image identifier and the deleted base database identifier corresponding to the deleted image identifier.
[0179] Corresponds to Fig.11 The embodiment of the present invention further provides a base database synchronization device, which is applied to a business server set up in an intranet. Fig.14 As shown, the device includes a file generating module 1402 and a file sending module 1404 connected in sequence, wherein the functions of each module are as follows:
[0180] A file generating module 1402, configured to generate a first Oplog file based on an update operation of a first base database set of a business server;
[0181] The file sending module 1404 is used to send the first Oplog file to the synchronization server through the gateway, so that the synchronization server applies the first Oplog file to update the second base library set in the external network, and responds to the base library synchronization request of the portable device, and updates the third base library set on the portable device based on the updated second base library set; wherein the gateway is a network switch used to isolate the internal network and the external network, and the synchronization server is set in the external network.
[0182] In one possible implementation manner, the file generation module 1402 is further used to: generate a base64 encoding of a target image when a target image is added or modified; use the base64 encoding as the content of a url field to generate a first Oplog file, wherein the first Oplog file includes a url field.
[0183] In another possible implementation, the above-mentioned device also includes: a picture adding module, used to receive a second Oplog file sent by the synchronization server through the gateway; the second Oplog file is generated by the synchronization server based on the updated picture of the portable device; based on the second Oplog file, the target base library of the first base library set is updated.
[0184] In another possible implementation, the device further includes: a picture deletion module, for receiving a third Oplog file sent by the synchronization server through a gateway; the third Oplog file is generated by the synchronization server based on deleted pictures of a portable device; and based on the third Oplog file, the deleted pictures are deleted in the target base library of the first base library set.
[0185] The bottom library synchronization device provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned bottom library synchronization method embodiment. For the sake of brief description, for parts not mentioned in the embodiment of the bottom library synchronization device, reference may be made to the corresponding contents in the aforementioned bottom library synchronization method embodiment.
[0186] The embodiment of the present invention further provides an electronic device, such as Fig.15 As shown, it is a schematic diagram of the structure of the electronic device, wherein the electronic device includes a processor 151 and a memory 152, the memory 152 stores machine executable instructions that can be executed by the processor 151, and the processor 151 executes the machine executable instructions to implement the above-mentioned base library synchronization method.
[0187] exist Fig.15 In the illustrated embodiment, the electronic device further includes a bus 153 and a communication interface 154 , wherein the processor 151 , the communication interface 154 and the memory 152 are connected via the bus.
[0188] The memory 152 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 154 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.15 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0189] The processor 151 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 151. The above processor 151 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, or other mature storage media in the art. The storage medium is located in the memory, and the processor 151 reads the information in the memory 152 and completes the steps of the base database synchronization method of the aforementioned embodiment in combination with its hardware.
[0190] An embodiment of the present invention also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned base library synchronization method. The specific implementation can be found in the aforementioned method embodiment, which will not be repeated here.
[0191] The computer program products of the base database synchronization method, base database synchronization device and electronic system provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the base database synchronization method described in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0192] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0193] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0194] In the description of the present invention, it should be noted that the terms “first”, “second” and “third” are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0195] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A base database synchronization method, characterized in that: The method is applied to a synchronization server arranged on an external network, and the method comprises: Receive a first Oplog file sent by a gateway; wherein the gateway is a network gate used to isolate the intranet from the extranet, and the first Oplog file is a file generated by a business server in the intranet performing an update operation on a first base database set in the intranet; Applying the first Oplog file to update the second base database set in the external network; In response to a base library synchronization request of the portable device, updating a third base library set on the portable device based on the updated second base library set; The method further comprises: If the picture update information sent by the portable device is received, the updated picture and the updated base library identifier corresponding to the updated picture are parsed from the picture update information, and the first base library corresponding to the updated base library identifier of the second base library set is updated based on the updated picture; A second Oplog file is generated based on the updated first base database, and the second Oplog file is sent to the business server through the gateway to update the base database corresponding to the updated base database identifier in the first base database set.
2. The method according to claim 1, characterized in that: The url field of the first Oplog file is the base64 encoding of the target image modified or added by the business server; The step of applying the first Oplog file to update the second base database set in the external network includes: Parsing the first Oplog file to obtain the target image; Determining whether the target image is a newly added image according to the identifier of the target image; If yes, add the target image to the second base library set on the external network; If not, the target image is used to replace the image corresponding to the identifier in the second base library set.
3. The method according to claim 2, characterized in that The step of parsing the first Oplog file to obtain the target image includes: Parsing the first Oplog file through the MongoShake service to obtain the base64 code in the url field of the first Oplog file; The target image is generated based on the base64 encoding.
4. The method according to claim 1, characterized in that: The base library synchronization request carries base library list information corresponding to the third base library set on the portable device; The step of updating the third base library set on the portable device based on the updated second base library set comprises: Determine the target base library corresponding to the portable device according to business requirements; Check whether the base library list information contains the base library identifier of the target base library; If yes, updating the target base database on the portable device based on the picture sets in the target base databases on the portable device and the synchronization server respectively; If not, the target base library or the feature information corresponding to each picture in the target base library is sent to the portable device to add the target base library or the feature information corresponding to each picture in the target base library to the third base library set.
5. The method according to claim 4, characterized in that The step of updating the target base library on the portable device based on the picture sets in the target base libraries on the portable device and the synchronization server respectively includes: Comparing whether the number of pictures in the picture collections in the respective target base libraries on the portable device and the synchronization server is equal; If not, sending the base database identifier of the target base database on the synchronization server and the picture identifier set of the pictures in the target base database on the synchronization server to the portable device; Receiving a set of picture identifiers to be added returned by the portable device based on the base database identifier and the picture identifier set; Searching the target base database of the synchronization server for a set of pictures to be added corresponding to the set of picture identifiers to be added; The found feature information of the picture set to be added or each picture in the picture set to be added is sent to the portable device, so as to add the picture set to be added or each picture in the picture set to be added to the target base library of the portable device.
6. The method according to claim 1, characterized in that The step of generating a second Oplog file based on the updated first base database includes: A base64 code is generated based on the updated image in the first base database after update, and a second Oplog file is generated using the base64 code as the content of the url field, wherein the second Oplog file includes the url field.
7. The method according to claim 1, characterized in that The method further comprises: If the picture deletion information sent by the portable device is received, a deletion picture identifier and a deletion base library identifier corresponding to the deletion picture identifier are parsed from the picture deletion information, and the picture corresponding to the deletion picture identifier in the second base library corresponding to the deletion base library identifier of the second base library set is deleted; A third Oplog file is generated based on the deleted second base database, and the third Oplog file is sent to the business server through the gateway to delete the picture corresponding to the deleted picture identifier in the base database corresponding to the deleted base database identifier in the first base database set.
8. The method according to claim 1, characterized in that The operating system of the synchronization server is different from the operating system of the portable device, and the synchronization server and the portable device are connected in communication via ICE technology.
9. A base database synchronization method, characterized in that: The method is applied to a portable device arranged in an external network, and the method comprises: Sending a base database synchronization request to a synchronization server; wherein the synchronization server is arranged in the external network, and a second base database set is stored in the external network, and the base databases in the second base database set are synchronized with the base databases in the first base database set of the business server in the intranet; Receiving picture update information returned by the synchronization server based on the base database synchronization request and the second base database set; Updating a third base library set on the portable device based on the picture update information; The method further comprises: If there is an image update, image update information is sent to the synchronization server so that the synchronization server updates the second base database set based on the image update information; wherein the image update information carries the updated image and the updated base database identifier corresponding to the updated image.
10. The method according to claim 9, characterized in that The base library synchronization request carries base library list information corresponding to the third base library set on the portable device; The step of receiving the picture update information returned by the synchronization server based on the base database synchronization request and the second base database set includes: receiving a base database identifier of a target base database and a set of picture identifiers of pictures in the target base database returned by the synchronization server based on the base database synchronization request and the second base database set; the base database identifier is included in the base database list information; Determine a set of picture identifiers to be added based on the base database identifier and the set of picture identifiers; Returning the set of image identifiers to be added to the synchronization server; receiving a set of pictures to be added corresponding to the set of picture identifiers to be added or feature information of each picture in the set of pictures to be added sent by the synchronization server; The feature information of the to-be-added picture set or each picture in the to-be-added picture set is added to the target base database of the base database identifier of the portable device.
11. The method according to claim 9, characterized in that The base library synchronization request carries base library list information corresponding to the third base library set on the portable device; The step of receiving the picture update information returned by the synchronization server based on the base database synchronization request and the second base database set includes: receiving a target base database or feature information corresponding to each image in the target base database returned by the synchronization server based on the base database synchronization request and the second base database set; the base database identifier of the target base database is not included in the base database list information; The target base library or feature information corresponding to each image in the target base library is added to the third base library set on the portable device.
12. The method according to claim 9, characterized in that The method further comprises: If an image is deleted, image deletion information is sent to the synchronization server so that the synchronization server updates the second base library set based on the image deletion information; wherein the image deletion information carries a deleted image identifier and a deleted base library identifier corresponding to the deleted image identifier.
13. A base database synchronization method, characterized in that: The method is applied to a business server set up in an intranet, and the method comprises: Generate a first Oplog file based on an update operation of a first base database set of the business server; The first Oplog file is sent to the synchronization server through the gateway, so that the synchronization server applies the first Oplog file to update the second base library set in the external network, and responds to the base library synchronization request of the portable device, updates the third base library set on the portable device based on the updated second base library set; wherein the gateway is a network gate for isolating the internal network and the external network, and the synchronization server is set in the external network; The method further comprises: receiving a second Oplog file sent by the synchronization server through the gateway; the second Oplog file is generated by the synchronization server based on the update picture of the portable device; The target base database of the first base database set is updated based on the second Oplog file.
14. The method according to claim 13, characterized in that The step of generating a first Oplog file based on the update operation of the first base database set of the business server includes: When a target image is added or modified, a base64 encoding of the target image is generated; The base64 encoding is used as the content of the url field to generate a first Oplog file, wherein the first Oplog file includes the url field.
15. The method according to claim 13, characterized in that The method further comprises: Receiving a third Oplog file sent by the synchronization server through the gateway; the third Oplog file is generated by the synchronization server based on the deleted picture of the portable device; The deleted picture is deleted in the target base library of the first base library set based on the third Oplog file.
16. A bottom warehouse synchronization device, characterized in that: The device is applied to a synchronization server arranged in an external network, and the device comprises: A first receiving module is used to receive a first Oplog file sent by a gateway; wherein the gateway is a network gate used to isolate the intranet from the extranet, and the first Oplog file is a file generated by a business server in the intranet performing an update operation on a first base database set in the intranet; A first update module, used to apply the first Oplog file to update the second base database set in the external network; A second updating module, configured to update a third base library set on the portable device based on the updated second base library set in response to a base library synchronization request of the portable device; The second update module is also used for: if image update information sent by the portable device is received, parsing the updated image and the updated base library identifier corresponding to the updated image from the image update information, and updating the first base library corresponding to the updated base library identifier in the second base library set based on the updated image; generating a second Oplog file based on the updated first base library, and sending the second Oplog file to the business server through the gateway to update the base library corresponding to the updated base library identifier in the first base library set.
17. A bottom warehouse synchronization device, characterized in that: The device is applied to a portable device arranged in an external network, and the device comprises: A request sending module, used for sending a base database synchronization request to a synchronization server; wherein the synchronization server is arranged in the external network, and a second base database set is stored in the external network, and the base databases in the second base database set are synchronized with the base databases in the first base database set of the business server in the intranet; A second receiving module, configured to receive the picture update information returned by the synchronization server based on the base database synchronization request and the second base database set; A third updating module, configured to update a third base library set on the portable device based on the image update information; The third update module is also used to: if there is an image update, send image update information to the synchronization server, so that the synchronization server updates the second base library set based on the image update information; wherein the image update information carries the updated image and the updated base library identifier corresponding to the updated image.
18. A bottom warehouse synchronization device, characterized in that: The device is applied to a business server arranged in an intranet, and the device comprises: A file generation module, used to generate a first Oplog file based on the update operation of the first base database set of the business server; A file sending module, used for sending the first Oplog file to the synchronization server through the gateway, so that the synchronization server applies the first Oplog file to update the second base library set in the external network, and responds to the base library synchronization request of the portable device, updates the third base library set on the portable device based on the updated second base library set; wherein the gateway is a network gate for isolating the internal network and the external network, and the synchronization server is set in the external network; The device also includes: a picture adding module, which is used to receive a second Oplog file sent by the synchronization server through the gateway; the second Oplog file is generated by the synchronization server based on the updated picture of the portable device; and the target base library of the first base library set is updated based on the second Oplog file.
19. An electronic system, characterized in that: The electronic system includes: a portable device, a synchronization server and a business server; Wherein, the business server comprises a first storage device for storing a first base library set and a first computer program, and a first processing device; The synchronization server includes a second storage device for storing a second base library set and a second computer program, and a second processing device; The portable device includes a third storage device for storing a third base library set and a third computer program, and a third processing device; The first computer program, when executed by the first processing device, executes the base database synchronization method according to any one of claims 13 to 15; The second computer program, when executed by the second processing device, executes the base database synchronization method according to any one of claims 1 to 8; The third computer program executes the base database synchronization method according to any one of claims 9 to 12 when executed by the third processing device.
20. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the base database synchronization method as described in any one of claims 1 to 15 are executed.
