Synchronization Method, Device, Computer Equipment and Storage Medium for Material Data
By reading and processing preset amounts of material data in the message queue, synchronizing and querying request responses in the database, the server crash problem during the synchronization of large batches of data on multiple clients is solved, and stable synchronization is achieved.
Patent Information
- Application Number
- CN202111297967.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-04
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-11-04
AI Technical Summary
In the prior art, when multi-clients synchronize large batches of data, the server is prone to crash due to excessive request volume and cannot achieve stable synchronization.
Read the preset number of target material data in the message queue, perform parameter checksum filtering, synchronize the data to the database, and send synchronization results in response to the query request of the service server.
By controlling the data processing speed, preventing the system from crashing, multiple clients can achieve stable synchronization of large batches of data.
Smart Images

Figure CN114116889B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication technologies, and in particular, to a method, device, computer device, and storage medium for synchronizing material data. Background Art
[0002] In the information age, the information interaction between the client and the server has become normal. With the development of network technologies, the amount of data is also increasing continuously. Therefore, the large-scale data synchronization of multiple clients has become an indispensable technology.
[0003] In traditional technologies, there are generally two ways to achieve data synchronization between the server and the client. One method is that the server actively requests the client to synchronize data. This method cannot meet the requirement of synchronizing multiple clients together, and when the IP address of the client is uncertain, the server will not be able to send a synchronization request. Another method is that the client sends a data synchronization request to the server. However, when multiple clients send a large amount of data to the server at the same time, the server will crash due to the excessive number of requests. Summary of the Invention
[0004] Based on this, in view of the above technical problems, it is necessary to provide a method, device, computer device, and storage medium for synchronizing material data that can achieve stable synchronization of a large amount of data for multiple clients.
[0005] A method for synchronizing material data, the method comprising:
[0006] Reading a preset number of target material data from a message queue; each material data in the message queue is data deposited into the message queue by a business server;
[0007] Performing parameter verification and filtering processing on the target material data;
[0008] After completing the parameter verification and filtering processing, synchronizing the processed target material data to the database to obtain a synchronization result;
[0009] Responding to a first query request carrying a server identifier initiated by the business server, and obtaining the synchronization results of the material data corresponding to the business server according to the server identifier;
[0010] Sending the synchronization results to the business server respectively.
[0011] In one embodiment, before synchronizing the processed target material data to the database, it further includes:
[0012] Obtaining display position information corresponding to the target material data according to the target material data;
[0013] Search the database according to the display location information to obtain the display location corresponding to the target material data;
[0014] Retrieving historical material data in the display position according to the display position, and obtaining material data to be synchronized corresponding to the target material data from the database;
[0015] The synchronizing the processed target material data to the database includes:
[0016] Based on the processed target material data, the material data to be synchronized in the database is updated.
[0017] In one embodiment, after sending the synchronization results to the service servers respectively, the method further includes:
[0018] When the business server does not receive the synchronization result of the requested material data after a preset interval and initiates a second query request, obtaining the synchronization result of the corresponding material data based on the server identifier and material identifier carried in the second query request;
[0019] The material identifier is an identifier of the material data requested that has not been received.
[0020] In one embodiment, after synchronizing the processed target material data to the database, the method further includes:
[0021] The synchronization result is stored so that when a query request is received from the business service, the stored synchronization result is obtained and returned;
[0022] The synchronization result includes synchronization success, or synchronization failure and the reason for the failure.
[0023] In one embodiment, synchronizing the processed target material data with the database to obtain a synchronization result includes:
[0024] Synchronizing the processed target material data to the database in the form of a transaction;
[0025] When the synchronization is successful, a synchronization result is obtained to indicate the success of the synchronization;
[0026] When synchronization fails, the transaction is rolled back to restore the data modified in the database during the synchronization process.
[0027] In one embodiment, the material data includes a network storage address of a material picture; the network storage address is an address for the material picture obtained by the business server from a file server through a material identifier.
[0028] A synchronization device for material data, the device comprising:
[0029] A reading module, configured to read a preset number of target material data from a message queue; each material data in the message queue is data deposited into the message queue by a service server;
[0030] A processing module, configured to perform parameter verification and filtering processing on the target material data;
[0031] A synchronization module, configured to synchronize the processed target material data to the database after completing parameter verification and filtering processing, to obtain a synchronization result;
[0032] An obtaining module, configured to, in response to a first query request carrying a server identifier initiated by the service server, obtain the synchronization result of each material data corresponding to the service server according to the server identifier;
[0033] A returning module, configured to return the synchronization result to the corresponding service server respectively.
[0034] In one embodiment, the device further comprises:
[0035] A retrieval module, configured to obtain display position information corresponding to the target material data according to the target material data; retrieve in the database according to the display position information to obtain a display position corresponding to the target material data; retrieve historical material data in the display position according to the display position, and obtain to-be-synchronized material data corresponding to the target material data from the database;
[0036] The synchronization module is further configured to update the to-be-synchronized material data in the database based on the processed target material data.
[0037] In one embodiment, the obtaining module is further configured to, when the service server initiates a second query request after a preset interval without receiving the synchronization result of the requested material data, obtain the synchronization result of the corresponding material data based on the server identifier and material identifier carried in the second query request;
[0038] Wherein, the material identifier is the identifier of the unreceived requested material data.
[0039] In one embodiment, the device further comprises:
[0040] A storage module, configured to store the synchronization result, so as to obtain the stored synchronization result and return it when receiving a query request initiated by the service;
[0041] Among them, the synchronization result includes synchronization success, or synchronization failure and the reason for failure.
[0042] In one embodiment, the synchronization module is further configured to synchronize the processed target material data to the database in the form of a transaction;
[0043] When the synchronization is successful, a synchronization result for identifying successful synchronization is obtained;
[0044] When the synchronization fails, a transaction rollback is performed to restore the data modified in the database during the synchronization process.
[0045] A computer device includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor is caused to execute the steps of the above-described synchronization method of material data.
[0046] A computer-readable storage medium has a computer program stored thereon. When the computer program is executed by a processor, the processor is caused to execute the steps of the above-described synchronization method of material data.
[0047] In the above synchronization method, device, computer device, and storage medium of material data, a preset number of target material data are read from a message queue; each material data in the message queue is data deposited in the message queue by a business server; parameter verification and filtering processing are performed on the target material data; after the parameter verification and filtering processing are completed, the processed target material data is synchronized to a database to obtain a synchronization result; in response to a first query request carrying a server identifier initiated by the business server, the synchronization results of the respective material data corresponding to the business server are obtained according to the server identifier; and the synchronization results are respectively sent to the business server. By reading a preset number of target material data at a certain processing speed, the processing speed of the data in the message queue can be controlled to prevent the system from crashing due to excessive processing requests, thereby realizing stable synchronization of a large amount of data by multiple clients. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is an application environment diagram of the synchronization method of material data in one embodiment;
[0049] Figure 2 It is a flowchart of the synchronization method of material data in one embodiment;
[0050] Figure 3 It is a schematic diagram of message queue enqueueing and dequeueing in one embodiment;
[0051] Figure 4 It is a schematic diagram of obtaining a synchronization result in one embodiment;
[0052] Figure 5 Schematic diagram of the synchronization process of material data in an embodiment;
[0053] Figure 6 Flow schematic diagram of obtaining display position information in an embodiment;
[0054] Figure 7 Schematic diagram of obtaining display position information in an embodiment;
[0055] Figure 8 Structural block diagram of the material data synchronization device in an embodiment;
[0056] Figure 9 Structural block diagram of the material data synchronization device in another embodiment;
[0057] Figure 10 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0058] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] The material data synchronization method provided by the present application can be applied to an application environment as Figure 1 shown. In this application environment, it includes a business server 102 and a server-side business server 104.
[0060] The server-side business server 104 reads a preset number of target material data from the message queue; each material data in the message queue is data deposited into the message queue by the business server; performs parameter verification and filtering processing on the target material data; after completing the parameter verification and filtering processing, synchronizes the processed target material data to the database to obtain a synchronization result; in response to a first query request carrying a server identifier initiated by the business server, obtains the synchronization results of the material data corresponding to the business server according to the server identifier; and sends the synchronization results to the business server respectively.
[0061] Among them, the business server 102 and the server-side business server 104 can be independent physical servers respectively, or service nodes in a blockchain system. Each service node in this blockchain system forms a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP).
[0062] In addition, the business server 102 and the service-side business server 104 can also be a server cluster composed of multiple physical servers, and can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0063] The business server 102 and the service-side business server 104 may be connected via Bluetooth, USB (Universal Serial Bus), or a network, etc., and this application does not impose any limitation thereto.
[0064] In one embodiment, Figure 2 As shown, a material data synchronization method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the service-side business server in the example:
[0065] S202, reading a preset number of target material data from the message queue; each material data in the message queue is data stored in the message queue by the business server.
[0066] Material data includes material identification, material price, material inventory, and the network storage address of images. The network storage address is the address of the material image that the business server obtains from the file server using the material identification. The message queue can use messaging systems such as RabbitMQ, ActiveMQ, and Kafka. The business server can be a client business server.
[0067] In one embodiment, Figure 3 As shown, after receiving the synchronization request, the business server forwards the acquired material data that needs to be synchronized to the message queue. The service-side business server consumes the message at a certain processing speed and processes the message to achieve data synchronization.
[0068] The purpose of presetting the number of messages the server reads from the message queue is to control the frequency of message consumption. The server sets the number of messages it reads from the message queue each time. For example, the server can read 2000 messages from the message queue at a time. After processing these 2000 messages, the server will read 2000 messages from the message queue again.
[0069] S204: Perform parameter verification and filtering on the target material data.
[0070] Among them, the parameters include the identifier, price, and inventory of the material. The parameter verification of the server-side business server includes checking whether the format of the parameters conforms to the format requirements of the database; the filtering process includes filtering out redundant and abnormal parameters.
[0071] S206, after completing the parameter verification and filtering process, synchronize the processed target material data to the database to obtain a synchronization result.
[0072] In one embodiment, the server-side business server synchronizes the processed target material data to the database in the form of a transaction; when the synchronization is successful, a synchronization result for identifying the successful synchronization is obtained; when the synchronization fails, a transaction rollback is performed to restore the data modified in the database during the synchronization process.
[0073] Among them, a transaction refers to a program execution unit that accesses and may update various data items in the database. All operations within the transaction scope are consistent, that is, all operations are either all executed or all not executed. For example, when the target material data is successfully synchronized with the database, the transaction is committed to permanently save all operations within the transaction; when the target material data fails to be synchronized with the database, the transaction is rolled back to revoke all operations within the transaction scope, and the database data remains unchanged after the rollback.
[0074] S208, in response to the first query request carrying the server identifier initiated by the business server, obtain the synchronization results of the material data corresponding to the business server according to the server identifier.
[0075] In one embodiment, when the business server initiates a second query request after a preset interval without receiving the synchronization result of the requested material data, the server-side business server obtains the synchronization result of the corresponding material data based on the server identifier and material identifier carried in the second query request; where the material identifier is the identifier of the material for which the requested material data has not been received.
[0076] For example, as Figure 4 shown, the Figure 4 query request in can be the first query request or the second query request. When the query request only carries the server identifier, then the query request is the first query request; when the query request carries the server identifier and the material identifier, then the query request is the second query request. Therefore, when the query request is the first query request, the server-side business server obtains the synchronization result through the server identifier; when the query request is the second query request, the server-side business server obtains the synchronization result through the server identifier and the material identifier. After obtaining the synchronization result, the server-side business server modifies the synchronization result return status of the database and then returns the synchronization result to the business server.
[0077] In one embodiment, after S208, the method may further include: the server-side business server stores the synchronization result so that when receiving a query request initiated by a business service, it can obtain the stored synchronization result and return it; wherein, the synchronization result includes synchronization success, or synchronization failure and the reason for failure.
[0078] In one embodiment, the server-side business server will receive the first query request sent by the business server only after receiving each material data and waiting for a period of time. The business server can preset the time interval between sending the material data and sending the first query request. The preset time interval can be several seconds, several minutes, or other interval times.
[0079] S210, send the synchronization result to the business server respectively.
[0080] In one embodiment, after the server-side business server finishes sending, it will update the sending status in each material synchronization result and change the sending status to sent. When the business server sends the first query request again, the material synchronization results with the sending status of sent will not be sent again.
[0081] In one embodiment, when the business server sends the material data to the message queue, the business server will update the sending status field corresponding to the material data to success. When the synchronization result returned by the server-side business server is successful, the business server will update the synchronization result field corresponding to the material data to success, that is, the data synchronization is completed.
[0082] In another embodiment, when the synchronization result returned by the server-side business server is a failure, the business server will change both the synchronization result field and the sending status field corresponding to the material data to failure. The business server will update the material data with synchronization failure according to the reason for failure. After the update is completed, the material data will be sent again.
[0083] To enable those skilled in the art to more intuitively understand the method for synchronizing material data, in combination with Figure 5For explanation. After receiving the synchronization request, the client business server starts to retrieve and save the material data that needs to be synchronized. The client business server obtains the material image data from the client file server through the material identifier and uploads it to the server file server; after the server file server stores the material image data, it returns the network storage address of the image to the client business server. The client business server forwards all the acquired material data that needs to be synchronized to the message queue. The server business server consumes the messages in the message queue, performs material information synchronization operations, and stores a synchronization status table that records the synchronization results. The client business server sends a query request to query the product synchronization status. After receiving the query request from the client business server, the server business server returns the query result.
[0084] In the above-mentioned material data synchronization method, a preset number of target material data are read from the message queue; each material data in the message queue is data stored in the message queue by the business server; parameter verification and filtering processing are performed on the target material data; after completing the parameter verification and filtering processing, the processed target material data is synchronized to the database to obtain a synchronization result; in response to a first query request carrying a server identifier initiated by the business server, the synchronization result of each material data corresponding to the business server is obtained based on the server identifier; and the synchronization result is sent to the business server separately. By reading a preset number of target material data at a certain processing speed, the processing speed of the data in the message queue can be controlled to prevent the system from crashing due to an excessive number of processing requests, thereby achieving stable synchronization of large quantities of data by multiple clients.
[0085] In one embodiment, as shown in step 6, before step S206, the method further includes:
[0086] S602: Acquire display location information corresponding to the target material data according to the target material data.
[0087] The display position information may also be referred to as exhibition hall information.
[0088] In one embodiment, Figure 7 As shown, the service-side business server will perform parameter verification and filtering on the display position information to ensure the accuracy of the display position information, and then use the display position information to search in the database.
[0089] In one embodiment, the service-side business server determines whether the material should be automatically put on the shelf based on the target material data. When the material needs to be automatically put on the shelf, the service-side business server automatically puts the material on the shelf after the material data synchronization is completed.
[0090] S604: Search the database according to the display location information to obtain the display location corresponding to the target material data.
[0091] Among them, the display position includes the store on the sales platform, and the database can retrieve all material information in the store based on the store information.
[0092] S606: Retrieve historical material data in the display position according to the display position, and obtain the material data to be synchronized corresponding to the target material data from the database.
[0093] Wherein, based on the processed target material data, the service-side business server will update the material data to be synchronized in the database.
[0094] In the above embodiment, the display location information corresponding to the target material data is obtained based on the target material data; a database search is performed based on the display location information to obtain the display location corresponding to the target material data; and historical material data in the display location is retrieved based on the display location to obtain the material data to be synchronized corresponding to the target material data from the database. By obtaining the display location information corresponding to the target material data based on the target material data, the database can be easily retrieved for the material data to be synchronized, thereby improving synchronization efficiency.
[0095] It should be understood that although Figure 2 , 6 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 2 , 6 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The order of execution of these steps or stages is not necessarily one by one, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0096] In one embodiment, Figure 8 As shown, a material data synchronization device is provided. The device can be a software module or a hardware module, or a combination of the two to form a part of a computer device. The device specifically includes: a reading module 802, a processing module 804, a synchronization module 806, an acquisition module 808 and a return module 810, wherein:
[0097] The reading module 802 is used to read a preset number of target material data in the message queue; each material data in the message queue is data stored in the message queue by the business server;
[0098] Processing module 804, used for parameter verification and filtering of target material data;
[0099] A synchronization module 806, configured to synchronize the processed target material data to a database after completing parameter verification and filtering processing, so as to obtain a synchronization result;
[0100] An acquisition module 808, configured to respond to a first query request carrying a server identifier initiated by a business server, and obtain the synchronization results of the material data corresponding to the business server according to the server identifier;
[0101] A return module 810, configured to return the synchronization results to the corresponding business servers respectively.
[0102] In the above embodiment, by reading a preset number of target material data in a message queue; each material data in the message queue is data stored in the message queue by a business server; performing parameter verification and filtering processing on the target material data; after completing parameter verification and filtering processing, synchronizing the processed target material data to a database to obtain a synchronization result; responding to a first query request carrying a server identifier initiated by a business server, and obtaining the synchronization results of the material data corresponding to the business server according to the server identifier; sending the synchronization results to the business servers respectively. By reading a preset number of target material data at a certain processing speed, the processing speed of the data in the message queue can be controlled, preventing the system from crashing due to excessive processing requests, thereby realizing stable synchronization of a large number of data by multiple clients.
[0103] In one embodiment, as Figure 9 , the apparatus further includes:
[0104] A retrieval module 812, configured to obtain display position information corresponding to the target material data according to the target material data; perform retrieval in the database according to the display position information to obtain a display position corresponding to the target material data; retrieve historical material data in the display position according to the display position, and obtain to-be-synchronized material data corresponding to the target material data from the database;
[0105] The synchronization module 806 is further configured to update the to-be-synchronized material data in the database based on the processed target material data.
[0106] In one embodiment, the acquisition module 808 is further configured to, when the business server initiates a second query request after not receiving the synchronization result of the requested material data within a preset interval, obtain the synchronization result of the corresponding material data based on the server identifier and the material identifier carried in the second query request;
[0107] Wherein, the material identifier is the identifier of the requested material data that has not been received.
[0108] In one embodiment, the apparatus further includes:
[0109] A storage module 814, configured to store the synchronization result, so that when a query request is initiated by a service, the stored synchronization result can be obtained and returned.
[0110] The synchronization result includes synchronization success, or synchronization failure and the reason for failure.
[0111] In one embodiment, the synchronization module 806 is further configured to synchronize the processed target material data to the database in the form of a transaction.
[0112] When the synchronization is successful, a synchronization result for identifying the successful synchronization is obtained.
[0113] When the synchronization fails, a transaction rollback is performed to restore the data modified in the database during the synchronization process.
[0114] For the specific limitations of the synchronization device for material data, reference can be made to the limitations of the synchronization method for material data in the foregoing text, which will not be elaborated herein. Each module in the above synchronization device for material data can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0115] In one embodiment, a computer device is provided. The computer device can be a service-side business server, and its internal structure diagram can be as Figure 10 shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store material data. The network interface of the computer device is used to communicate with an external business server through a network connection. When the computer program is executed by the processor, a synchronization method for material data is implemented.
[0116] Those skilled in the art can understand that Figure 10 the structure shown in
[0117] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0118] In one embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0119] In one embodiment, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the above method embodiments.
[0120] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the above method embodiments. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application may include at least one of non-volatile and volatile memories. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0121] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0122] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for synchronizing material data, characterized in that, The method includes: Reading a preset number of target material data from a message queue; each material data in the message queue is data deposited into the message queue by a business server; Performing parameter verification and filtering processing on the target material data; After completing the parameter verification and filtering processing, synchronizing the processed target material data to a database to obtain a synchronization result; Responding to a first query request carrying a server identifier initiated by the business server, and obtaining the synchronization results of the material data corresponding to the business server according to the server identifier; Sending the synchronization results to the business server respectively; Before synchronizing the processed target material data to the database, it further includes: Obtaining display position information corresponding to the target material data according to the target material data; retrieving in the database according to the display position information to obtain the display position corresponding to the target material data; retrieving historical material data in the display position according to the display position, and obtaining the material data to be synchronized corresponding to the target material data from the database; The synchronizing the processed target material data to the database includes: Updating the material data to be synchronized in the database based on the processed target material data.
2. The method according to claim 1, wherein After sending the synchronization results to the business server respectively, the method further includes: When the business server initiates a second query request because it has not received the synchronization result of the requested material data after a preset interval, obtaining the synchronization result of the corresponding material data based on the server identifier and material identifier carried by the second query request; Wherein, the material identifier is the identifier of the material data for which the request has not been received.
3. The method according to claim 1, wherein After synchronizing the processed target material data to the database, it further includes: Storing the synchronization result so that when a query request initiated by the business service is received, the stored synchronization result is obtained and returned; Wherein, the synchronization result includes synchronization success, or synchronization failure and the reason for failure.
4. The method according to claim 1, wherein The synchronizing the processed target material data to the database to obtain a synchronization result includes: Synchronizing the processed target material data to the database in the form of a transaction; When the synchronization is successful, obtaining a synchronization result for identifying the synchronization success; When the synchronization fails, performing a transaction rollback to restore the data modified in the database during the synchronization process.
5. The method according to claim 1, wherein The material data includes the network storage address of a material picture; the network storage address is the address of the material picture obtained by the business server from a file server through a material identifier.
6. A synchronization device for material data, characterized in that, The device includes: A reading module, configured to read a preset number of target material data from a message queue; each material data in the message queue is data deposited into the message queue by a business server; A processing module, configured to perform parameter verification and filtering processing on the target material data; A synchronization module, configured to synchronize the processed target material data to a database after completing the parameter verification and filtering processing to obtain a synchronization result; An acquisition module, configured to, in response to a first query request carrying a server identifier initiated by the service server, acquire the synchronization results of respective material data corresponding to the service server according to the server identifier; A return module, configured to return the synchronization results to the corresponding service server respectively; Wherein, the device further includes: A retrieval module, configured to acquire display position information corresponding to the target material data according to the target material data; retrieve in the database according to the display position information to obtain the display position corresponding to the target material data; retrieve historical material data in the display position according to the display position, and acquire the material data to be synchronized corresponding to the target material data from the database; The synchronization module is further configured to update the material data to be synchronized in the database based on the processed target material data.
7. The device according to claim 6, characterized in that The acquisition module is further configured to, when the service server initiates a second query request after a preset interval without receiving the synchronization result of the requested material data, acquire the synchronization result of the corresponding material data based on the server identifier and the material identifier carried in the second query request; Wherein, the material identifier is the identifier of the unreceived requested material data.
8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer program product, characterized in that, The computer program product includes computer instructions, and when the computer instructions are executed, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Data synchronization method and device, computer equipment and storage medium
CN110704458A
Data synchronization method, system and device
CN111309747A
Data synchronization method, device and equipment and storage medium
CN111400408A