CN114116889A - Method and device for synchronizing material data, computer equipment and storage medium - Google Patents

Method and device for synchronizing material data, computer equipment and storage medium Download PDF

Info

Publication number
CN114116889A
CN114116889A CN202111297967.7A CN202111297967A CN114116889A CN 114116889 A CN114116889 A CN 114116889A CN 202111297967 A CN202111297967 A CN 202111297967A CN 114116889 A CN114116889 A CN 114116889A
Authority
CN
China
Prior art keywords
material data
synchronization
target material
database
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111297967.7A
Other languages
Chinese (zh)
Inventor
吴其佑
张炜
李彬
何俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jindiyun Technology Co ltd
Original Assignee
Jindiyun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jindiyun Technology Co ltd filed Critical Jindiyun Technology Co ltd
Priority to CN202111297967.7A priority Critical patent/CN114116889A/en
Publication of CN114116889A publication Critical patent/CN114116889A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a method and a device for synchronizing material data, computer equipment and a storage medium. The method comprises the following steps: reading a preset amount of target material data in a message queue; each material data in the message queue is stored into the message queue by the service server; carrying out parameter verification and filtering processing on target material data; after parameter checking and filtering processing is completed, synchronizing the processed target material data to a database to obtain a synchronization result; responding to a first query request which is initiated by a service server and carries a server identifier, and acquiring a synchronization result of each material data corresponding to the service server according to the server identifier; and respectively sending the synchronization results to the service servers. And the stable synchronization of a plurality of clients on the large-batch data can be realized.

Description

Method and device for synchronizing material data, computer equipment and storage medium
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a method and an apparatus for synchronizing material data, a computer device, and a storage medium.
Background
In the information age, information interaction between a client and a server becomes a normal state, and with the development of network technology, the data volume is continuously increased, so that large-batch data synchronization of multiple clients becomes an indispensable technology.
In the conventional technology, there are generally two ways to implement data synchronization between a server and a client. One method is that a server actively requests a client for synchronous data, the method cannot meet the requirement of synchronous data of multiple clients, and when the IP address of the client is uncertain, the server cannot perform synchronous request; another method is that a client sends a data synchronization request to a server, but when a plurality of clients send a large amount of data to the server together, the server runs out because the request amount is too large.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a method, an apparatus, a computer device, and a storage medium for synchronizing material data of large-batch data stably by multiple clients.
A method of synchronizing material data, the method comprising:
reading a preset amount of target material data in a message queue; each material data in the message queue is stored into the message queue by the service server;
performing parameter verification and filtering processing on the target material data;
after parameter checking and filtering processing is completed, synchronizing the processed target material data to the database to obtain a synchronization result;
responding to a first query request which is initiated by the service server and carries a server identifier, and acquiring a synchronization result of each material data corresponding to the service server according to the server identifier;
and respectively sending the synchronization results to the service server.
In one embodiment, before synchronizing the processed target material data to the database, the method 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 a display position corresponding to the target material data;
retrieving historical material data in a display position according to the display position, and acquiring material data to be synchronized corresponding to the target material data from the database;
the step of synchronizing the processed target material data to the database comprises:
and updating the data of the materials to be synchronized in the database based on the processed target material data.
In one embodiment, after the sending the synchronization results to the service servers respectively, the method further includes:
when the service server does not receive the synchronization result of the requested material data after the preset interval time and initiates a second query request, acquiring the synchronization result of the corresponding material data based on the server identification and the material identification carried by the second query request;
wherein the material identification is the identification of the unreceived requested material data.
In one embodiment, after the synchronizing the processed target material data to the database, the method further includes:
storing the synchronization result so as to obtain the stored synchronization result and return the synchronization result when receiving the inquiry request initiated by the service;
wherein the synchronization result comprises synchronization success or synchronization failure and a failure reason.
In one embodiment, 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 a transaction form;
when the synchronization is successful, obtaining a synchronization result used for identifying the successful synchronization;
and when the synchronization fails, performing transaction rollback to recover the data modified in the database in the synchronization process.
In one embodiment, the material data includes a network storage address of the material picture; the network storage address is an address which is obtained by the business server from a file server through a material identifier and aims at the material picture.
A device for synchronizing material data, the device comprising:
the reading module is used for reading a preset amount of target material data in the message queue; each material data in the message queue is stored into the message queue by the service server;
the processing module is used for carrying out parameter verification and filtering processing on the target material data;
the synchronization module is used for synchronizing the processed target material data to the database after parameter verification and filtering processing are finished, and a synchronization result is obtained;
the acquisition module is used for responding to a first query request which is initiated by the service server and carries a server identifier, and acquiring a synchronization result of each material data corresponding to the service server according to the server identifier;
and the return module is used for respectively returning the synchronization results to the corresponding service servers.
In one embodiment, the apparatus further comprises:
the retrieval module is used for acquiring 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 a display position corresponding to the target material data; retrieving historical material data in a display position according to the display position, and acquiring material data to be synchronized corresponding to the target material data from the database;
and the synchronization module is further used for updating the data of the materials to be synchronized in the database based on the processed target material data.
In one embodiment, the obtaining module is further configured to, when the service server does not receive the synchronization result of the requested material data after a preset interval time and initiates a second query request, obtain 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 identification is the identification of the unreceived requested material data.
In one embodiment, the apparatus further comprises:
the storage module is used for storing the synchronization result so as to obtain the stored synchronization result and return the synchronization result when receiving the inquiry request initiated by the business service;
wherein the synchronization result comprises synchronization success or synchronization failure and a failure reason.
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;
when the synchronization is successful, obtaining a synchronization result used for identifying the successful synchronization;
and when the synchronization fails, performing transaction rollback to recover the data modified in the database in the synchronization process.
A computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the above-described method of synchronization of material data.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, causes the processor to carry out the steps of the above-mentioned method of synchronization of material data.
The method and the device for synchronizing the material data, the computer equipment and the storage medium read a preset amount of target material data in a message queue; each material data in the message queue is stored into the message queue by the service server; carrying out parameter verification and filtering processing on target material data; after parameter checking and filtering processing is completed, synchronizing the processed target material data to a database to obtain a synchronization result; responding to a first query request which is initiated by a service server and carries a server identifier, and acquiring a synchronization result of each material data corresponding to the service server according to the server identifier; and respectively sending the synchronization results to the service servers. By reading the preset amount of target material data according to a certain processing speed, the processing speed of the data in the message queue can be controlled, and the system is prevented from running due to excessive processing request amount, so that the stable synchronization of mass data of multiple clients is realized.
Drawings
FIG. 1 is a diagram of an exemplary implementation of a method for synchronizing material data;
FIG. 2 is a schematic flow chart diagram illustrating a method for synchronizing material data according to one embodiment;
FIG. 3 is a diagram of message enqueuing in one embodiment;
FIG. 4 is a diagram illustrating an embodiment of obtaining synchronization results;
FIG. 5 is a schematic illustration of a process for synchronizing material data in one embodiment;
FIG. 6 is a flow diagram illustrating the process of obtaining presentation bit information according to one embodiment;
FIG. 7 is a diagram illustrating the acquisition of presentation bit information in one embodiment;
FIG. 8 is a block diagram of a synchronization apparatus for material data according to an embodiment;
FIG. 9 is a block diagram showing the structure of a synchronizing device for material data according to another embodiment;
FIG. 10 is a diagram showing an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for synchronizing the material data can be applied to the application environment shown in fig. 1. In the application environment, a service server 102 and a server-side service server 104 are included.
The server service server 104 reads a preset amount of target material data in the message queue; each material data in the message queue is stored into the message queue by the service server; carrying out parameter verification and filtering processing on target material data; after parameter checking and filtering processing is completed, synchronizing the processed target material data to a database to obtain a synchronization result; responding to a first query request which is initiated by a service server and carries a server identifier, and acquiring a synchronization result of each material data corresponding to the service server according to the server identifier; and respectively sending the synchronization results to the service servers.
The service server 102 and the service server 104 may be independent physical servers or service nodes in a blockchain system, a point-To-point (P2P, Peer To Peer) network is formed between the service nodes in the blockchain system, and the P2P Protocol is an application layer Protocol operating on a Transmission Control Protocol (TCP).
In addition, the service server 102 and the service-side service server 104 may also be a server cluster formed by a plurality of physical servers, and may be cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, Network services, cloud communication, middleware services, domain name services, security services, Content Delivery Networks (CDNs), big data platforms, and artificial intelligence platforms.
The service server 102 and the service server 104 may be connected through communication connection manners such as bluetooth, USB (Universal Serial Bus), or network, which is not limited herein.
In an embodiment, as shown in fig. 2, a method for synchronizing material data is provided, which is described by taking the method as an example for being applied to a service server in fig. 1, and includes the following steps:
s202, reading a preset amount of target material data in a message queue; and each material data in the message queue is stored into the message queue by the service server.
The material data comprises material identification, material price, material stock and network storage address of pictures; the network storage address is an address which is obtained by the service server from the file server through the material identifier and aims at the material picture, and the message queue can use message systems such as RabbitMQ, ActiveMQ and Kafka. The service server may be a client service server.
In an embodiment, as shown in fig. 3, after receiving the synchronization request, the service server forwards the acquired material data to be synchronized to the message queue, and the service server at the server end consumes the message at a certain processing speed to process the message to implement data synchronization.
The preset server service server reads the number of messages in the message queue to control the frequency of message consumption. The service server at the service end sets the number of messages read in the message queue each time, for example, the service server at the service end can read 2000 messages in the message queue each time, and after the 2000 messages are processed, the service server at the service end can read the messages in the 2000 message queues again.
And S204, performing parameter verification and filtering processing on the target material data.
Wherein, the parameters comprise the identification, price and inventory of the material, and the parameter verification of the service server at the server end comprises the step of checking whether the format of the parameters meets the format requirement of the database; the filtering process includes filtering out unwanted parameters and anomalous parameters.
And S206, after the parameter verification and filtering processing is finished, synchronizing the processed target material data to a database to obtain a synchronization result.
In one embodiment, the server service server synchronizes the processed target material data to the database in a transaction form; when the synchronization is successful, obtaining a synchronization result used for identifying the successful synchronization; and when the synchronization fails, performing transaction rollback to recover the data modified in the database in the synchronization process.
A transaction refers to a unit of program execution that accesses and possibly updates various data items in a database. All operations within a transaction have consistency, i.e., all operations are either all executed or none are executed. For example, when the target material data and the database are successfully synchronized, the transaction is submitted, and all operations in the transaction are permanently saved; and when the synchronization of the target material data and the database fails, rolling back the transaction, cancelling all operations in the transaction range, and leaving the database data unchanged after rolling back.
S208, responding to a first query request which is initiated by the service server and carries the server identifier, and acquiring the synchronization result of each material data corresponding to the service server according to the server identifier.
In one embodiment, when a service server does not receive a synchronization result of requested material data after a preset interval time and initiates a second query request, a service server at a server side obtains a synchronization result of corresponding material data based on a server identifier and a material identifier carried by the second query request; and the material identification is the identification that the requested material data is not received.
For example, as shown in fig. 4, the query request in fig. 4 may be a first query request or a second query request, and when the query request only carries the server identifier, the query request is the first query request; and when the query request carries the server identifier and the material identifier, the query request is the second query request. Therefore, when the query request is the first query request, the service end service server obtains the synchronization result through the server identifier; and when the query request is a second query request, the service server at the server side acquires a synchronization result through the server identifier and the material identifier. After the synchronization result is obtained, the service server at the server side can modify the synchronization result return state of the database, and then the synchronization result is returned to the service server.
In one embodiment, after S208, the method may further include: the server-side service server stores the synchronization result so as to obtain and return the stored synchronization result when receiving a query request initiated by the service; wherein the synchronization result comprises synchronization success or synchronization failure and a failure reason.
In an embodiment, the service server receives the first query request sent by the service server after receiving the material data and waiting for a period of time, and the service server may preset a time interval between sending the material data and sending the first query request. Wherein the predetermined time interval may be a few seconds, a few minutes, or other time intervals.
And S210, respectively sending the synchronization results to the service servers.
In one embodiment, after the server-side service server finishes sending, the sending state in each material synchronization result is updated, and the sending state is modified to be sent. And when the business server sends the first query request again, the material synchronization result which is sent in the sending state is not sent again.
In one embodiment, after the service server sends the material data to the message queue, the service server updates the sending status field corresponding to the material data to be successful. And when the synchronization result returned by the service server at the server side is successful, the service server updates the synchronization result field corresponding to the material data to be successful, namely the data synchronization is completed.
In another embodiment, when the synchronization result returned by the service server at the server side is a failure, the service server modifies both the synchronization result field and the sending state field corresponding to the material data into a failure. And the service server updates the synchronous failed material data according to the failure reason, and sends the material data again after the update is finished.
In order to make those skilled in the art more intuitively understand the synchronization method of the material data, the description is made with reference to fig. 5. After receiving the synchronization request, the client service server starts to retrieve and store material data needing synchronization, acquires the material picture data from the client file server through the material identifier and uploads the material picture data to the server file server; after the server file server stores the material picture data, the network storage address of the picture is returned to the client business server, and the client business server forwards all the acquired material data needing to be synchronized to the message queue. The server service server consumes the messages in the message queue, performs material information synchronization operation and stores a synchronization state table recording synchronization results. The client service server sends an inquiry request to inquire the commodity synchronous state. After receiving the query request of the client service server, the server service server returns a query result.
In the method for synchronizing the material data, a preset amount of target material data is read from a message queue; each material data in the message queue is stored into the message queue by the service server; carrying out parameter verification and filtering processing on target material data; after parameter checking and filtering processing is completed, synchronizing the processed target material data to a database to obtain a synchronization result; responding to a first query request which is initiated by a service server and carries a server identifier, and acquiring a synchronization result of each material data corresponding to the service server according to the server identifier; and respectively sending the synchronization results to the service servers. By reading the preset amount of target material data according to a certain processing speed, the processing speed of the data in the message queue can be controlled, and the system is prevented from running due to excessive processing request amount, so that the stable synchronization of mass data of multiple clients is realized.
In one embodiment, as shown in fig. 6, before S206, the method further includes:
and S602, obtaining the display position information corresponding to the target material data according to the target material data.
The exhibition position information may also be referred to as exhibition hall information.
In one embodiment, as shown in fig. 7, the service server performs parameter check and filtering processing on the display bit information to ensure the accuracy of the display bit information, and then retrieves the display bit information in the database.
In one embodiment, the server-side service server determines whether the material is automatically put on shelf according to the target material data, and when the material needs to be automatically put on shelf, the server-side service server automatically puts on shelf the material after the material data is synchronously completed.
And S604, retrieving in the database according to the display position information to obtain the display position corresponding to the target material data.
The display position comprises a shop on the sales platform, and the database can retrieve all material information in the shop according to the shop information.
And S606, retrieving historical material data in the display position according to the display position, and acquiring material data to be synchronized corresponding to the target material data from the database.
And based on the processed target material data, the service end service server updates the material data to be synchronized in the database.
In the above embodiment, the display position information corresponding to the target material data is obtained according to the target material data; retrieving in a database according to the display position information to obtain a display position corresponding to the target material data; and retrieving historical material data in the display position according to the display position, and acquiring the material data to be synchronized corresponding to the target material data from the database. The display position information corresponding to the target material data is obtained according to the target material data, so that the database can conveniently retrieve the data of the materials to be synchronized, and the synchronization efficiency is improved.
It should be understood that although the steps in the flowcharts of fig. 2 and 6 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2 and 6 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the other steps or stages.
In one embodiment, as shown in fig. 8, there is provided a device for synchronizing material data, where the device may be a part of a computer device using a software module or a hardware module, or a combination of the two modules, and the device specifically includes: a read module 802, a processing module 804, a synchronization module 806, an acquisition module 808, and a return module 810, wherein:
a reading module 802, configured to read a preset amount of target material data in a message queue; each material data in the message queue is stored into the message queue by the service server;
the processing module 804 is used for performing parameter verification and filtering processing on the target material data;
a synchronization module 806, configured to synchronize the processed target material data with a database after parameter checking and filtering are completed, so as to obtain a synchronization result;
an obtaining module 808, configured to respond to a first query request with a server identifier initiated by a service server, and obtain, according to the server identifier, a synchronization result of each piece of material data corresponding to the service server;
and a returning module 810, configured to return the synchronization results to the corresponding service servers respectively.
In the embodiment, a preset amount of target material data is read from the message queue; each material data in the message queue is stored into the message queue by the service server; carrying out parameter verification and filtering processing on target material data; after parameter checking and filtering processing is completed, synchronizing the processed target material data to a database to obtain a synchronization result; responding to a first query request which is initiated by a service server and carries a server identifier, and acquiring a synchronization result of each material data corresponding to the service server according to the server identifier; and respectively sending the synchronization results to the service servers. By reading the preset amount of target material data according to a certain processing speed, the processing speed of the data in the message queue can be controlled, and the system is prevented from running due to excessive processing request amount, so that the stable synchronization of mass data of multiple clients is realized.
In one embodiment, as shown in fig. 9, the apparatus further comprises:
a retrieval module 812, configured to obtain display position information corresponding to the target material data according to the target material data; retrieving in a database according to the display position information to obtain a display position corresponding to the target material data; retrieving historical material data in the display position according to the display position, and acquiring material data to be synchronized corresponding to the target material data from a database;
the synchronization module 806 is further configured to update the data of the to-be-synchronized material in the database based on the processed target material data.
In one embodiment, the obtaining module 808 is further configured to, when the service server does not receive the synchronization result of the requested material data after the preset interval time and initiates a second query request, obtain 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 identification is the identification of the unreceived requested material data.
In one embodiment, the apparatus further comprises:
a storage module 814, configured to store the synchronization result, so that when receiving a query request initiated by a service, the storage module obtains the stored synchronization result and returns the synchronization result;
wherein, the synchronization result comprises the synchronization success or the synchronization failure and the failure reason.
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;
when the synchronization is successful, obtaining a synchronization result used for identifying the successful synchronization;
and when the synchronization fails, performing transaction rollback to recover the data modified in the database in the synchronization process.
For specific definition of the material data synchronization device, reference may be made to the above definition of the material data synchronization method, and details are not described here. All or part of each module in the material data synchronization device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, and the computer device may be a server service server, and the internal structure diagram thereof may be as shown in fig. 10. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing material data. The network interface of the computer device is used for communicating with an external service server through network connection. The computer program is executed by a processor to implement a method of synchronizing material data.
Those skilled in the art will appreciate that the architecture shown in fig. 10 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps in the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for synchronizing material data, the method comprising:
reading a preset amount of target material data in a message queue; each material data in the message queue is stored into the message queue by the service server;
performing parameter verification and filtering processing on the target material data;
after parameter checking and filtering processing is completed, synchronizing the processed target material data to the database to obtain a synchronization result;
responding to a first query request which is initiated by the service server and carries a server identifier, and acquiring a synchronization result of each material data corresponding to the service server according to the server identifier;
and respectively sending the synchronization results to the service server.
2. The method of claim 1, wherein before synchronizing the processed target material data to the database, further comprising:
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 a display position corresponding to the target material data;
retrieving historical material data in a display position according to the display position, and acquiring material data to be synchronized corresponding to the target material data from the database;
the step of synchronizing the processed target material data to the database comprises:
and updating the data of the materials to be synchronized in the database based on the processed target material data.
3. The method of claim 1, wherein after the sending the synchronization results to the service servers respectively, the method further comprises:
when the service server does not receive the synchronization result of the requested material data after the preset interval time and initiates a second query request, acquiring the synchronization result of the corresponding material data based on the server identification and the material identification carried by the second query request;
wherein the material identification is the identification of the unreceived requested material data.
4. The method of claim 1, wherein after synchronizing the processed target material data to the database, further comprising:
storing the synchronization result so as to obtain the stored synchronization result and return the synchronization result when receiving the inquiry request initiated by the service;
wherein the synchronization result comprises synchronization success or synchronization failure and a failure reason.
5. The method according to claim 1, wherein the synchronizing the processed target material data to the database to obtain a synchronization result comprises:
synchronizing the processed target material data to the database in a transaction form;
when the synchronization is successful, obtaining a synchronization result used for identifying the successful synchronization;
and when the synchronization fails, performing transaction rollback to recover the data modified in the database in the synchronization process.
6. The method of claim 1, wherein the material data comprises a network storage address of a material picture; the network storage address is an address which is obtained by the business server from a file server through a material identifier and aims at the material picture.
7. A device for synchronizing material data, the device comprising:
the reading module is used for reading a preset amount of target material data in the message queue; each material data in the message queue is stored into the message queue by the service server;
the processing module is used for carrying out parameter verification and filtering processing on the target material data;
the synchronization module is used for synchronizing the processed target material data to the database after parameter verification and filtering processing are finished, and a synchronization result is obtained;
the acquisition module is used for responding to a first query request which is initiated by the service server and carries a server identifier, and acquiring a synchronization result of each material data corresponding to the service server according to the server identifier;
and the return module is used for respectively returning the synchronization results to the corresponding service servers.
8. The method of claim 1, wherein the apparatus further comprises:
the retrieval module is used for acquiring 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 a display position corresponding to the target material data; retrieving historical material data in a display position according to the display position, and acquiring material data to be synchronized corresponding to the target material data from the database;
and the synchronization module is further used for updating the data of the materials to be synchronized in the database based on the processed target material data.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN202111297967.7A 2021-11-04 2021-11-04 Method and device for synchronizing material data, computer equipment and storage medium Pending CN114116889A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111297967.7A CN114116889A (en) 2021-11-04 2021-11-04 Method and device for synchronizing material data, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111297967.7A CN114116889A (en) 2021-11-04 2021-11-04 Method and device for synchronizing material data, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114116889A true CN114116889A (en) 2022-03-01

Family

ID=80381172

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111297967.7A Pending CN114116889A (en) 2021-11-04 2021-11-04 Method and device for synchronizing material data, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114116889A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115544034A (en) * 2022-09-15 2022-12-30 中国人民财产保险股份有限公司 Data consistency method and service system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115544034A (en) * 2022-09-15 2022-12-30 中国人民财产保险股份有限公司 Data consistency method and service system

Similar Documents

Publication Publication Date Title
CN102333029B (en) Routing method in server cluster system
CN107357896A (en) Expansion method, device, system and the data base cluster system of data-base cluster
CN111970315A (en) Method, device and system for pushing message
CN107153644B (en) Data synchronization method and device
CN113010549B (en) Data processing method based on remote multi-activity system, related equipment and storage medium
CA3131954C (en) Information synchronization method, system, apparatus, computer device and storage medium
US11226982B2 (en) Synchronization of offline instances
CN110196843B (en) File distribution method based on container cluster and container cluster
CN113094430B (en) Data processing method, device, equipment and storage medium
TWI716822B (en) Method and device for correcting transaction causality, and electronic equipment
CN108228581B (en) Zookeeper compatible communication method, server and system
CN111338834B (en) Data storage method and device
US10545667B1 (en) Dynamic data partitioning for stateless request routing
CN114116889A (en) Method and device for synchronizing material data, computer equipment and storage medium
CN107357557B (en) Information updating method and device
CN114827171A (en) Information synchronization method and device, computer equipment and storage medium
US8266634B2 (en) Resource assignment system with recovery notification
CN110555040A (en) Data caching method and device and server
CN114205354B (en) Event management system, event management method, server, and storage medium
JP2005534099A (en) Database synchronization
CN105357222B (en) A kind of distribution Session management middleware
CN114138895A (en) Data synchronization method and device for multiple data sources, computer equipment and storage medium
CN107203915B (en) Data storage method and device
CN105933352B (en) Method of data synchronization, client and system between client-based server
CN110300140A (en) For the method for content update, refreshing client and network node in cloud distribution network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination