CN111831954A - Content data updating method and device, computer equipment and storage medium - Google Patents

Content data updating method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111831954A
CN111831954A CN202010698068.7A CN202010698068A CN111831954A CN 111831954 A CN111831954 A CN 111831954A CN 202010698068 A CN202010698068 A CN 202010698068A CN 111831954 A CN111831954 A CN 111831954A
Authority
CN
China
Prior art keywords
information
content data
target
change information
identifier
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.)
Granted
Application number
CN202010698068.7A
Other languages
Chinese (zh)
Other versions
CN111831954B (en
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.)
Hanhai Information Technology Shanghai Co Ltd
Original Assignee
Hanhai Information Technology Shanghai 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 Hanhai Information Technology Shanghai Co Ltd filed Critical Hanhai Information Technology Shanghai Co Ltd
Priority to CN202010698068.7A priority Critical patent/CN111831954B/en
Publication of CN111831954A publication Critical patent/CN111831954A/en
Application granted granted Critical
Publication of CN111831954B publication Critical patent/CN111831954B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • 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
    • 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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application relates to a content data updating method, a content data updating device, computer equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: in response to receiving the target change information, acquiring a target information identifier of the target change information; adding the target information identifier to the information identifier set in response to the target information identifier being distinct from the information identifiers in the information identifier set; in response to receiving the change information with the information identifier being the same as the target information identifier within the specified time period, not processing the change information; and responding to the end of the specified duration, and updating the content data of the consuming end according to the target information identification. By the method, in the process of updating the content data, the same content data only needs to be imported once within the specified duration range, so that the operation of starting the import flow of the same content data for multiple times within a short time is avoided, the pressure on a service layer is reduced, and the waste of thread resources and machine resources is reduced.

Description

Content data updating method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for updating content data, a computer device, and a storage medium.
Background
In the process of content data synchronization, a content data producer sends a content data newly-added message to a content data center station, simultaneously sends related basic elements (texts, pictures and videos) to integrity audit one by one, and sends a corresponding content data audit message to the content data center station after the integrity audit is finished.
In the related art, each time a station in content data receives a piece of content data change information, a content data import flow is started, and the latest data of the content data is synchronized in time.
However, in the above related art, when there are many associated basic elements in the same piece of content data, the station in the content data receives multiple pieces of content data change information for the same piece of content data in a short time, so that the station in the content data needs to start an import process for the same piece of content data multiple times in a short time, which causes a great pressure on a service layer and a waste of thread resources and machine resources.
Inventive content data
The application relates to a content data updating method, a content data updating device, a computer device and a storage medium, which can realize request deduplication within a specified duration and reduce repeated sending of change information for the same piece of content data within the specified duration, thereby reducing pressure on a service layer and waste of thread resources and machine resources. The technical scheme is as follows:
in one aspect, a content data updating method is provided, and the method includes:
in response to receiving target change information, acquiring a target information identifier of the target change information, wherein the target information identifier is used for identifying content data corresponding to the target change information; the target change information is generated corresponding to any subdata in the content data when the content data of the production end is updated; the target change information is used for triggering the updating of the content data of the consuming end;
in response to the target information identity being distinct from information identities in an information identity set, adding the target information identity to the information identity set, the information identities in the information identity set being non-duplicative;
in response to receiving change information with the information identifier being the same as the target information identifier within a specified duration, not processing the change information;
and responding to the end of the specified duration, and updating the content data of the consuming end according to the target information identification.
In a possible implementation manner, after updating the content data of the consuming end according to the target information identifier, the method further includes:
and deleting the target information identifier in the information identifier set.
In one possible implementation, the method further includes:
and generating a delay message related to the target change information in response to the target information identifier being different from the information identifiers in the information identifier set, wherein the delay message comprises the target information identifier and a target interface corresponding to the target change information.
In a possible implementation manner, the updating the content data of the consuming end according to the target information identifier in response to the end of the specified duration includes:
responding to the end of the specified duration, calling the target interface, and checking updated updating data in the content data in the production end indicated by the target information identification;
and updating the content data in the consuming end according to the updating data.
In one possible implementation, the method further includes:
and in response to the target information identifier being the same as any one of the information identifiers in the set of information identifiers, not processing the target change information.
In one possible implementation, the method further includes:
and adding a timestamp corresponding to the target change information into a timestamp set in response to the target information identifier being different from the information identifiers in the information identifier set.
In a possible implementation manner, after the specified duration is ended and the content data of the consuming end is updated according to the target information identifier, the method further includes:
and deleting the timestamp corresponding to the target change information in the timestamp set.
In one possible implementation, the method further includes:
querying the set of timestamps at a specified periodicity;
responding to an abnormal timestamp which is more than a time threshold value from the current query time in the timestamp set, and responding to the change information corresponding to the abnormal timestamp again;
and deleting the information identifier of the change information corresponding to the abnormal timestamp from the information identifier set.
In a possible implementation manner, the target change information is generated after any sub-data integrity audit in the content data passes.
In another aspect, there is provided a content data update system, the system including: a combiner, a timer and an actuator;
the merger is used for responding to the received target change information and acquiring a target information identifier of the target change information; in response to the target information identifier being distinct from information identifiers in an information identifier set, adding the target information identifier to the information identifier set; in response to receiving change information with the information identifier being the same as the target information identifier within a specified duration, not processing the change information; the target information identifier is used for identifying content data corresponding to the target change information; the target change information is generated corresponding to any subdata in the content data when the content data of the production end is updated; the target change information is used for triggering the updating of the content data of the consuming end;
the timer is used for setting the specified duration; responding to the end of the specified duration, and adding a delay message generated according to the target change information to a delay queue for consumption by the executor;
and the executor is used for updating the content data of the consuming end according to the delay message.
In another aspect, there is provided a content data updating apparatus, the apparatus including:
the identification acquisition module is used for responding to the received target change information and acquiring a target information identification of the target change information, wherein the target information identification is used for identifying content data corresponding to the target change information; the target change information is generated corresponding to any subdata in the content data when the content data of the production end is updated; the target change information is used for triggering the updating of the content data of the consuming end;
an identifier adding module, configured to add the target information identifier to an information identifier set in response to the target information identifier being different from information identifiers in the information identifier set, where the information identifiers in the information identifier set are non-duplicative;
the information processing module is used for responding to the change information with the information identification being the same as the target information identification received within a specified time length and not processing the change information;
and the updating module is used for responding to the end of the specified duration and updating the content data of the consuming end according to the target information identification.
In one possible implementation manner, the apparatus further includes:
and the identification deleting module is used for deleting the target information identification in the information identification set after the updating module updates the content data of the consuming end according to the target information identification.
In one possible implementation, the apparatus further includes:
and the delay message generation module is used for responding to the target information identifier different from the information identifier in the information identifier set, and generating a delay message related to the target change information, wherein the delay message comprises the target information identifier and a target interface corresponding to the target change information.
In one possible implementation manner, the update module is configured to,
responding to the end of the specified duration, calling the target interface, and checking updated updating data in the content data in the production end indicated by the target information identification;
and updating the content data in the consuming end according to the updating data.
In a possible implementation manner, the information processing module is configured to not process the target change information in response to that the target information identifier is the same as any one of the information identifiers in the information identifier set.
In one possible implementation, the apparatus further includes:
and the timestamp adding module is used for responding to the information identifier in the information identifier set different from the target information identifier, and adding a timestamp corresponding to the target change information into the timestamp set.
In one possible implementation, the apparatus further includes:
and the timestamp deleting module is used for deleting the timestamp corresponding to the target change information in the timestamp set after the updating module responds to the end of the specified duration and updates the content data of the consuming end according to the target information identifier.
In one possible implementation, the apparatus further includes:
the query module is used for querying the timestamp set in a specified period;
the re-response module is used for responding to the abnormal time stamps which are more than a time threshold value from the current query time in the time stamp set, and re-responding the change information corresponding to the abnormal time stamps once;
and the identifier deleting module is used for deleting the information identifier of the change information corresponding to the abnormal timestamp from the information identifier set.
In another aspect, a computer device is provided, which includes a processor and a memory, where at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the content data updating method provided in the embodiment of the present application.
In another aspect, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set, or a set of instructions is stored, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by a processor to implement the content data updating method provided in the embodiments of the present application.
In another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions 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 content data updating method provided in the above-described various alternative implementations.
The beneficial effect that technical scheme that this application provided brought includes at least:
by combining repeated change information for indicating that the same content data of the production end has changed into one piece of target change information within the specified time length range and updating the corresponding content data of the consumption end according to the target change information after the specified time length is over, the same content data only needs to be imported once within the specified time length range in the process of updating the content data, so that the operation of starting the import flow of the same content data for multiple times within a short time is avoided, the pressure on a service layer is reduced, and the waste of thread resources and machine resources is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram illustrating a content data update system provided by an exemplary embodiment of the present application;
FIG. 2 illustrates a flow chart of a content data update method shown in an exemplary embodiment of the present application;
FIG. 3 illustrates a flow chart of a content data update method shown in an exemplary embodiment of the present application;
FIG. 4 is a diagram illustrating a retry flow shown in an exemplary embodiment of the present application;
FIG. 5 illustrates a flow chart of a content data update method shown in an exemplary embodiment of the present application;
fig. 6 is a block diagram illustrating a content data update apparatus according to an exemplary embodiment of the present application;
FIG. 7 is a block diagram illustrating the structure of a computer device according to an example embodiment.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
First, the terms referred to in the embodiments of the present application will be briefly described:
1)Redis
redis is a new memory caching technology, is a storage system based on key-value structure data, and has the characteristics of high performance reading and writing, multi-data type support, data persistence, high available architecture, user-defined virtual memory support, distributed fragment clustering support, extremely high single-thread reading and writing performance and the like; the data structure storage system in the memory can be used as a database, a cache and message middleware. The data storage system is basically matched with a back-end database to store data which are frequently called by a user at present.
Redis is atomicity, i.e., an operation is not subdividable, either executed or not executed.
2)Tair
Tair is a storage system of key-value structure data, supports two storage modes based on memory and files by default, and corresponds to cache and persistent storage respectively. Tair functions are get, put, delete, and bulk interface.
3) Message Queue (MQ)
A message queue is a method of communication from an application to an application. Applications communicate by writing and retrieving queued data (messages) for the application without requiring a dedicated connection to link them. Message passing refers to the communication between programs by sending data in a message, rather than communicating with each other through direct calls, which are often used for techniques such as remote procedure calls. Queuing refers to the application communicating through a queue. The use of a message queue removes the requirement that the receiving and sending applications execute simultaneously.
4) Delaying messages
The delayed message means that the producer cannot be consumed by the consumer immediately after sending the message, and the producer can wait for a specified time before being consumed.
There are two delay strategies available for accessing MQ delayed messages, consuming group granularity delay and message granularity delay. The delay time supported by the message granularity delay is controlled at the production end and is limited by the delay time (5s-30 days), and the delay time of the consumption group granularity is controlled by the consumption end and is not limited. In the present embodiment, a consumption group granularity delay is employed.
Referring to fig. 1, which shows a schematic diagram of a content data updating system according to an exemplary embodiment of the present application, as shown in fig. 1, the content data updating system 100 includes a merger 101, a timer 102, and an executor 103.
The combiner 101 adopts a main standby mode, taking Redis as a main mode and Tair as an auxiliary mode; in the operation process of the content data updating system, if the Redis has a problem, the system can be switched to Tair in time to maintain the normal operation of the content data updating system. In the merger, change information of the same piece of content data is aggregated to the same key through key bizId _ bizType to achieve deduplication of the change information of the same piece of content data, wherein bizId represents an ID of the content data, bizType represents a type of the content data, and value is a timestamp used for recording a time when the change information of the same piece of content data is received for the first time.
The timer 102 adopts a design scheme based on Mafka delay messages, adds delay messages for different content data sent in the merger into a Mafka delay queue, and waits to be consumed by an executor.
The executor 103 is configured to listen to the delay message in the Mafka delay queue, and after receiving the delay message in the Mafka delay queue, execute a corresponding operation in response to the delay message.
Referring to fig. 2, which shows a flowchart of a content data updating method shown in an exemplary embodiment of the present application, the method may be performed by a content data updating system, which may be the content data updating system of fig. 1, and as shown in fig. 2, the method may include the following steps:
step 210, in response to receiving the target change information, obtaining a target information identifier of the target change information, where the target information identifier is used to identify content data corresponding to the target change information; the target change information is generated corresponding to any subdata in the content data when the content data of the production end is updated; the target change information is used for triggering the update of the content data of the consuming terminal.
In a possible implementation manner, when content data is updated, after the content data of the content data production end is updated, content data change information needs to be submitted to a content data updating system, and the content data updating system instructs the consumption end to update and synchronize the content data by starting a content data importing process.
In one possible implementation manner, the information identifier of the change information includes an ID of the content data and a type of the content data, and the ID (Identity Document) of the content data and the type of the content data indicate unique content data, and the type of the content data includes: note, short video, rating, etc. Each piece of content data contains at least one piece of sub-data, which is represented by associating each piece of content data with a plurality of basic elements, the basic elements include at least one of characters, pictures and videos, for example, a note can be associated with hundreds of pictures and a plurality of pieces of character content data, and when the content data is updated, a piece of change information is generated by changing each basic element in the same content data, and the change information indicates that the content data has changed.
Step 220, in response to the target information identifier being different from the information identifiers in the information identifier set, adding the target information identifier to the information identifier set, the information identifiers in the information identifier set being non-duplicative.
In a possible implementation manner, an information identifier set is provided in the content data updating system, and is used for storing information identifiers of change information for different content data, where the information identifiers stored in the information identifier set are non-repetitive, that is, only one change information exists in the information identifier set for the same content data at the same time. When the target information identifier is different from the information identifier in the information identifier set, it is indicated that the target change information is the first change information of the corresponding content data, and the target information identifier is added into the information identifier set to deduplicate other change information received within a specified time.
In response to receiving the changed information having the same information identifier as the target information identifier within the specified time period, the changed information is not processed, step 230.
In a possible implementation manner, the content data updating system starts to time after receiving the first change information for the corresponding content data until reaching a specified time length. When the change information with the same information identifier as the target information identifier is received in the specified time length, the content data corresponding to the change information and the target change information are determined to be the same, and the update of the same content data is indicated.
And 240, responding to the end of the specified duration, and updating the content data of the consuming terminal according to the target information identification.
In a possible implementation manner, in response to the end of the specified duration, the content data updating system starts a content data importing process, and updates and synchronizes the content data according to the target information identifier update consuming end.
To sum up, in the content data updating method provided in the embodiment of the present application, repeated change information indicating that the same content data of a production end has been changed is merged into a piece of target change information within a specified duration range, and after the specified duration is over, the corresponding content data of a consumption end is updated according to the target change information, so that in the content data updating process, the importing process of the content data is only executed once for the same content data within the specified duration range, thereby avoiding the operation of starting the importing process of the same content data for multiple times within a short time, reducing the pressure on a service layer, and reducing the waste of thread resources and machine resources.
Referring to fig. 3, which shows a flowchart of a content data updating method shown in an exemplary embodiment of the present application, the method may be performed by a content data updating system, which may be the content data updating system of fig. 1, and as shown in fig. 3, the method may include the following steps:
step 310, in response to receiving the target change information, obtaining a target information identifier of the target change information, where the target information identifier is used to identify content data corresponding to the target change information; the target change information is generated corresponding to any subdata in the content data when the content data of the production end is updated; the target change information is used for triggering the update of the content data of the consuming terminal.
In a possible implementation manner, the target change information is generated after any basic element in the corresponding content data is updated, where the updating of the basic element includes modification of the basic element, increase of the basic element, decrease of the basic element, and the like, for example, in a note containing ten pictures, one of the pictures is replaced, or one of the pictures is deleted, or one of the pictures is added, which all belong to updating of the basic element, and each updating of the basic element generates one piece of change information for the content data, and the target change information is any one of the pieces of change information.
In one possible implementation manner, the target information identifier of the target change information is expressed as: key-bizID _ bizType.
In a possible implementation manner, the target change information is generated after any sub-data integrity audit in the content data passes. When the content data of the production end is updated, each sub-data in the content data is sent to integrity audit, after the integrity audit is finished, each sub-data responds to a corresponding integrity audit result to indicate that the corresponding sub-data is legal, and each sub-data correspondingly generates a piece of change information to indicate that the content data corresponding to the sub-data is updated.
And 320, responding to the target information identifier different from the information identifiers in the information identifier set, adding the target information identifier to the information identifier set, and simultaneously generating a delay message related to the target change information, wherein the information identifiers in the information identifier set are non-repetitive, and the delay message comprises the target information identifier and a target interface corresponding to the target change information.
In a possible implementation manner, when it is determined that the target change information is change information that is sent for the first time with respect to a certain content data, the content data update system adds a target information identifier corresponding to the target change information to an information identifier set, and adds a delay message related to the target change information to a delay queue after a specified time length is finished according to the delay message, so as to instruct the update of the content data of the consuming end according to the delay message.
In a possible implementation manner, the delay message includes a target information identifier and a target interface corresponding to the target change information. The target information identifier is used for determining the ID and the type of content data updated by the production end through the target information identifier when indicating that content data of the consumption end is updated, the target interface corresponding to the target change information is used for indicating that a call of a corresponding target interface is triggered to update corresponding content data, a mapping relation exists between the target interface and the type of the content data, that is, which target interface is triggered is determined according to the type of the content data in the target information identifier, for example, bizType indicates that the type of the content data corresponding to the change information is a note, and the target interface is an import interface of the note content data; the bizType indicates that the type of the content data corresponding to the change information is short video, and the target interface is an import interface of the short video content data.
In one possible implementation manner, in response to that the target information identifier is different from the information identifiers in the information identifier set, a timestamp corresponding to the target change information is added to the timestamp set.
In one possible implementation, each piece of change information is associated with a unique timestamp to record the time when the change information is received by the content data update system. When the target change information is determined to be the change information which is transmitted for the first time aiming at a certain content data, the timestamp corresponding to the target change information is added to the timestamp set, that is, a plurality of pieces of change information aiming at the same content data can be provided within a period of time, the timestamp of each piece of change information is unique, only the timestamp set is recorded within the period of time, the timestamp of the first piece of change information aiming at the same content data is ignored, so that the content data updating system senses the time when the content data is updated for the first time within the period of time, and the timestamp corresponding to the target change information is recorded in the form of value.
In one possible implementation, the timestamp is recorded as a 13-bit millisecond timestamp, such as: 1592295928578, the time for receiving the change information is 2020-06-1616: 25:28:578, so as to ensure the uniqueness of the time stamp corresponding to each change information.
Step 330, in response to receiving the changed information with the information identifier being the same as the target information identifier within the specified time period, not processing the changed information.
In a possible implementation manner, the specified time length is counted when it is determined that the target information identifier of the target change information is different from the information identifiers in the information identifier set, and since timestamps of receiving the first piece of change information corresponding to different content data are overlapped or have a difference, the starting points of the specified time lengths corresponding to different content data may be the same or different. That is, at the same time, the content data update system may receive a plurality of pieces of change information, which are pieces of change information for different pieces of content data, for example, when the time stamp is 1592295928578, 3 pieces of change information are received at the same time, and the 3 pieces of change information are different from each other and are pieces of change information for 3 pieces of different content data, where change information 1 is the first piece of change information for content data 1, and therefore, when change information 1 is received, the specified duration timer for change information 1 is started; if the change information 2 is the non-first piece of change information for the content data 2, the change information 2 is not processed, and the corresponding designated time length counter is not triggered; since the change information 3 is the first piece of change information for the content data 3, the specified time period for the change information 3 is started when the change information 3 is received.
Step 340, responding to the end of the specified duration, calling the target interface, and checking the updated update data in the content data in the production end indicated by the target information identifier.
In a possible implementation manner, after the specified duration is over, the updated update data in the content data is back-checked in response to the target change information according to the target information identifier and the target interface included in the delay information.
In one possible implementation, the target interface is called using an RPC (Remote Procedure Call Protocol) generalized Call principle.
The RPC generalized call refers to that a Service call end directly initiates a Service call through a Generic Service interface under the condition that an interface jar packet does not need to be introduced. All POJOs in the parameters and return values are represented by maps. The generalized call does not need to pay attention to the service provider, and the exposure can be performed according to the normal service.
In the embodiment of the application, since different types of content data need to trigger different import interfaces of the content data, if jar packets need to be reintroduced every time a content type is newly accessed, the extensibility is poor due to the encapsulation of the call logic of the interfaces. The call to the target interface is thus realized by a generalized call.
And step 350, updating the content data in the consuming side according to the updating data.
In one possible implementation, updating the content data in the consuming side according to the update data includes: the method comprises the steps of converting and packaging updated data, preprocessing before warehousing (sensitive word filtering, picture structuring and the like), warehousing the data and post-processing the data (watermark detection, portrait detection and the like).
In one possible implementation manner, in response to failure of the operation of updating the content data in the consuming side according to the update data, a delay message of execution failure is added into the retry queue, and the number of execution failures of the delay message is recorded.
In one possible implementation manner, to avoid the influence of backlog of retry messages in the retry queue on normal execution of the delay messages in the delay queue, the retry queue is isolated from the delay queue, and the delay message that fails to be executed is retried in the retry queue until the execution succeeds or the number of execution failures exceeds a threshold number of failure times, please refer to fig. 4, which shows a schematic diagram of a retry procedure shown in an exemplary embodiment of the present application, and as shown in fig. 4, the retry procedure includes the following steps:
s410, a retry queue is listened.
And S420, responding to the monitored retry message in the retry queue, and acquiring the execution failure times of the retry message.
The retry message is a delay message of execution failure in the delay queue.
S430, responding to the execution failure times of the retry message being larger than the failure time threshold, reporting the retry message by dotting, and triggering an alarm.
And S440, reading the retry message in response to the execution failure times of the retry message not being more than the failure time threshold value.
The retry message includes an information identifier corresponding to the change information and an interface corresponding to the change information.
S450, updating the content data of the consuming end according to the retry message.
S460, determining whether the retry message is successfully executed, if so, ending the process, otherwise, executing step S470.
S470, record the number of failures of the retry message, and add the retry message to the retry queue again.
And step 360, deleting the target information identifier in the information identifier set.
In one possible implementation manner, to implement deduplication of the change information based on the specified duration, the target information identifier in the information identifier set is deleted after the specified duration is ended.
Because the time length of the specified duration is fixed, in a possible case, within the first specified duration, the change information for the same piece of content data is not received completely, and there is still change information for the content data subsequently, if the information identifier of the content data is always stored in the information identifier set, the change information for the content data subsequently is judged to be repeated change information and is not processed, but for the content data at the consuming end, the synchronization progress is only synchronized to the state at the end of the first specified duration, the change information for the content data subsequently cannot start the import program, so that data inconsistency occurs, for example, the specified duration is 1s, 5 pieces of change information for the content data a within the 1s are left after deduplication and merging, and corresponding delay messages are generated, after the specified duration is over, the delay message corresponding to the change information is consumed, if the immediate confirmation mechanism after consumption is not set, the subsequent change information aiming at the content data A is de-overlapped, but the corresponding delay message is not generated, so that the subsequent change information aiming at the content data A is not processed, and the update state of the content data A at the consumption end stays at the state of 1s end.
Or, in a possible case, there is a certain delay precision in the message queue delay message, under the action of the delay precision, the delay message will be consumed in advance, for example, the delay precision is 100ms, in a certain time window (assuming 1s), there are 5 pieces of change information of the content data a in the time period from 0ms to 900ms in the window, only 1 piece of change information is left after deduplication and combining, and a corresponding delay message is generated, and at the time of 900ms, the delay message is consumed in advance due to the delay precision problem, and one piece of change information of the content data a is received between 900ms and 1000 ms. If an instant confirmation mechanism after consumption is not designed, the last change information is lost, and the re-import of the content data A is not triggered, so that the last change of the content data A is not synchronized, and the data of the systems of the two parties are inconsistent.
Therefore, in order to avoid data inconsistency between the production end and the consumption end caused by the two situations, an instant confirmation mechanism after consumption is added, namely, when the target change information is responded, the target information identifier in the information identifier set is deleted. When the next change information which is the same as the content data corresponding to the target change information is received, the corresponding delay message can be regenerated, and the content data of the consuming end can be updated.
In a possible implementation manner, after the content data of the consuming end is identified according to the target information, the timestamp corresponding to the target change information in the timestamp set is deleted, so that when next change information for the same content data comes, and when the first change information of the content data in a new specified time length of the change information comes, the change information in the time length is deduplicated and a corresponding delay message is generated.
In response to the target information identity being the same as any of the set of information identities, the target change information is not processed, step 370.
In a possible implementation manner, in order to avoid a situation that, due to accidental factors, after content data of a consuming end is updated according to an information identifier, a corresponding information identifier in an information identifier set is not deleted, so that subsequent change information cannot be responded, the application provides a polling method:
querying the set of timestamps at a specified period;
responding to an abnormal time stamp which is more than a time threshold value from the current query time in the time stamp set, and responding to the change information corresponding to the abnormal time stamp again;
and deleting the information identifier of the target change information corresponding to the abnormal timestamp from the information identifier set.
It should be noted that, in the embodiment of the present application, the change information indicates that the content data corresponding to the production end has changed, so as to notify the content data updating system to synchronously update the content data of the consumption end, during this process, the update of each basic element of the content data sends a piece of change information to the content data updating system, but indicates that the content data has changed. In the embodiment of the present application, the change information for the same content data received in the specified time period is merged, that is, each original basic element is changed, and the content data is updated once in response to one change information, which is optimized to merge the change information for the same content data occurring in the specified time period into one piece, and to update the content data synchronously after the specified time period is timed out. Therefore, the content data updating method disclosed by the application is applied to scenes with low real-time requirements on content data updating.
To sum up, in the content data updating method provided in the embodiment of the present application, repeated change information indicating that the same content data of a production end has been changed is merged into a piece of target change information within a specified duration range, and after the specified duration is over, the corresponding content data of a consumption end is updated according to the target change information, so that in the content data updating process, the importing process of the content data is only executed once for the same content data within the specified duration range, thereby avoiding the operation of starting the importing process of the same content data for multiple times within a short time, reducing the pressure on a service layer, and reducing the waste of thread resources and machine resources.
In one possible implementation, the content data updating system is composed of a merger, a timer and an executor, and may be the content data updating system shown in fig. 1.
The merger is used for responding to the received target change information and acquiring a target information identifier of the target change information; adding the target information identifier to the information identifier set in response to the target information identifier being distinct from the information identifiers in the information identifier set; in response to receiving the change information with the information identifier being the same as the target information identifier within the specified time period, not processing the change information; the target information identifier is used for identifying content data corresponding to the target change information; the target change information is generated corresponding to any subdata in the content data when the content data of the production end is updated; the target change information is used for triggering the update of the content data of the consuming terminal.
The timer is used for setting a specified duration; responding to the end of the specified duration, and sending a delay message generated according to the target change information to an actuator;
the executor is used for updating the content data of the consuming end according to the delay message.
Referring to fig. 5, which shows a flowchart of a content data updating method according to an exemplary embodiment of the present application, the method is interactively performed by a merger, a timer and an executor, and as shown in fig. 5, the content data updating method includes:
in step 501, the merger acquires the target information identifier of the target change information in response to receiving the target change information.
Step 502, the merger determines whether the target information identifier exists in the information identifier set, if so, the merger does not respond to the target change information, otherwise, step 503 is executed.
In step 503, the merger adds the target information identifier to the information identifier set.
In step 504, the combiner generates delay information corresponding to the target change information.
Step 505, the combiner sends the delay information to the timer, and correspondingly, the timer receives the delay information.
In step 506, the timer starts a specified duration for timing.
In step 507, the timer responds to the end of the timing of the specified duration, and adds the delay information to the delay queue for consumption by the actuator.
In step 508, the executor responds to the monitored delay information in the delay queue to read the delay information.
In step 509, the executor updates the content data of the consuming end according to the delay information.
Step 510, the executor performs consumption instant feedback to the merger, and instructs the merger to delete the target information identifier in the information identifier set.
To sum up, in the content data updating method provided in the embodiment of the present application, repeated change information indicating that the same content data of a production end has been changed is merged into a piece of target change information within a specified duration range, and after the specified duration is over, the corresponding content data of a consumption end is updated according to the target change information, so that in the content data updating process, the importing process of the content data is only executed once for the same content data within the specified duration range, thereby avoiding the operation of starting the importing process of the same content data for multiple times within a short time, reducing the pressure on a service layer, and reducing the waste of thread resources and machine resources.
Referring to fig. 6, a block diagram of a content data updating apparatus according to an exemplary embodiment of the present application, which may be applied to a content data updating system, and which performs all or part of the steps in the embodiments shown in fig. 2, fig. 3 or fig. 5, is shown, where the content data updating system may be the content data updating system shown in fig. 1, and as shown in fig. 6, the apparatus includes:
the identifier obtaining module 610 is configured to, in response to receiving the target change information, obtain a target information identifier of the target change information, where the target information identifier is used to identify content data corresponding to the target change information; the target change information is generated corresponding to any subdata in the content data when the content data of the production end is updated; the target change information is used for triggering and updating the content data of the consuming terminal;
an identifier adding module 620, configured to add the target information identifier to the information identifier set in response to the target information identifier being different from the information identifiers in the information identifier set, where the information identifiers in the information identifier set are non-duplicative;
an information processing module 630, configured to, in response to receiving change information with an information identifier that is the same as the target information identifier within a specified time period, not process the change information;
and the updating module 640 is used for responding to the end of the specified duration and updating the content data of the consuming end according to the target information identifier.
In one possible implementation, the apparatus further includes:
and an identifier deleting module, configured to delete the target information identifier in the information identifier set after the updating module 640 updates the content data of the consuming end according to the target information identifier.
In one possible implementation, the apparatus further includes:
and the delay message generation module is used for responding to the target information identifier which is different from the information identifier in the information identifier set, and generating a delay message related to the target change information, wherein the delay message comprises the target information identifier and a target interface corresponding to the target change information.
In one possible implementation, the update module 640 is configured to,
responding to the end of the specified duration, calling a target interface, and backchecking updated update data in the content data in the production end indicated by the target information identifier;
and updating the content data in the consuming end according to the updating data.
In one possible implementation, the information processing module 630 is configured to not process the target change information in response to the target information identifier being the same as any one of the information identifiers in the information identifier set.
In one possible implementation, the apparatus further includes:
and the timestamp adding module is used for responding to the information identifier in the information identifier set different from the target information identifier, and adding a timestamp corresponding to the target change information into the timestamp set.
In one possible implementation, the apparatus further includes:
and the timestamp deleting module is configured to delete a timestamp corresponding to the target change information in the timestamp set after the updating module 640 responds to the end of the specified duration and updates the content data of the consuming end according to the target information identifier.
In one possible implementation, the apparatus further includes:
the query module is used for querying the timestamp set in a specified period;
the re-response module is used for responding to the abnormal time stamps which are more than the time threshold value from the current query time in the time stamp set and re-responding to the change information corresponding to the abnormal time stamps;
the identification deleting module is used for deleting the information identification of the change information corresponding to the abnormal timestamp from the information identification set.
In a possible implementation manner, the target change information is generated after any sub-data integrity audit in the content data passes.
To sum up, the content data updating apparatus provided in the embodiment of the present application is applied to a content data updating system, and combines repeated change information, which indicates that the same content data at a production end has been changed, into a piece of target change information within a specified time range, and updates corresponding content data at a consumption end according to the target change information after the specified time has elapsed, so that in the process of updating content data, the importing process of the content data is only executed once for the same content data within the specified time range, thereby avoiding the operation of starting the importing process for the same content data many times within a short time, reducing the pressure on a service layer, and reducing the waste of thread resources and machine resources.
FIG. 7 is a block diagram illustrating the structure of a computer device 700 according to an example embodiment. The computer device may be implemented as a merger, a timer and an executor in the content update system in the above-described aspect of the present application. The computer device 700 includes a Central Processing Unit (CPU) 701, a system Memory 704 including a Random Access Memory (RAM) 702 and a Read-Only Memory (ROM) 703, and a system bus 705 connecting the system Memory 704 and the CPU 701. The computer device 700 also includes a basic Input/Output system (I/O system) 706, which facilitates transfer of information between devices within the computer, and a mass storage device 707 for storing an operating system 713, application programs 714, and other program modules 715.
The basic input/output system 706 comprises a display 708 for displaying information and an input device 709, such as a mouse, keyboard, etc., for a user to input information. Wherein the display 708 and input device 709 are connected to the central processing unit 701 through an input output controller 710 coupled to the system bus 705. The basic input/output system 706 may also include an input/output controller 710 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input-output controller 710 may also provide output to a display screen, a printer, or other type of output device.
The mass storage device 707 is connected to the central processing unit 701 through a mass storage controller (not shown) connected to the system bus 705. The mass storage device 707 and its associated computer-readable media provide non-volatile storage for the computer device 700. That is, the mass storage device 707 may include a computer-readable medium (not shown) such as a hard disk or Compact Disc-Only Memory (CD-ROM) drive.
Without loss of generality, the computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash Memory or other solid state Memory technology, CD-ROM, Digital Versatile Disks (DVD), or other optical, magnetic, or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media is not limited to the foregoing. The system memory 704 and mass storage device 707 described above may be collectively referred to as memory.
According to various embodiments of the present application, the computer device 700 may also operate as a remote computer connected to a network via a network, such as the Internet. That is, the computer device 700 may be connected to the network 712 through the network interface unit 711 connected to the system bus 705, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 711.
The memory further includes one or more programs, the one or more programs are stored in the memory, and the central processing unit 701 implements all or part of the steps of the method shown in fig. 2, fig. 3 or fig. 5 by executing the one or more programs.
Those skilled in the art will appreciate that in one or more of the examples described above, the functions described in the embodiments of the present application may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
Embodiments of the present application further provide a computer-readable storage medium for storing at least one instruction, at least one program, a code set, or a set of instructions, which is loaded and executed by a processor to implement the above content data updating method. For example, the computer readable storage medium may be a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions 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 all or part of the steps of the content data updating method shown in the above embodiments.
It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The present application is intended to cover various modifications, alternatives, and equivalents, which may be included within the spirit and scope of the present application.

Claims (13)

1. A method for updating content data, the method comprising:
in response to receiving target change information, acquiring a target information identifier of the target change information, wherein the target information identifier is used for identifying content data corresponding to the target change information; the target change information is generated corresponding to any subdata in the content data when the content data of the production end is updated; the target change information is used for triggering the updating of the content data of the consuming end;
in response to the target information identity being distinct from information identities in an information identity set, adding the target information identity to the information identity set, the information identities in the information identity set being non-duplicative;
in response to receiving change information with the information identifier being the same as the target information identifier within a specified duration, not processing the change information;
and responding to the end of the specified duration, and updating the content data of the consuming end according to the target information identification.
2. The method of claim 1, wherein after updating the content data of the consuming end according to the target information identification, the method further comprises:
and deleting the target information identifier in the information identifier set.
3. The method of claim 1, further comprising:
and generating a delay message related to the target change information in response to the target information identifier being different from the information identifiers in the information identifier set, wherein the delay message comprises the target information identifier and a target interface corresponding to the target change information.
4. The method of claim 3, wherein the updating the content data of the consuming end according to the target information identifier in response to the end of the specified duration comprises:
responding to the end of the specified duration, calling the target interface, and checking updated updating data in the content data in the production end indicated by the target information identification;
and updating the content data in the consuming end according to the updating data.
5. The method of claim 1, further comprising:
and in response to the target information identifier being the same as any one of the information identifiers in the set of information identifiers, not processing the target change information.
6. The method of claim 1, further comprising:
and adding a timestamp corresponding to the target change information into a timestamp set in response to the target information identifier being different from the information identifiers in the information identifier set.
7. The method of claim 6, wherein after updating the content data of the consuming end according to the target information identifier in response to the end of the specified duration, the method further comprises:
and deleting the timestamp corresponding to the target change information in the timestamp set.
8. The method of claim 6, further comprising:
querying the set of timestamps at a specified periodicity;
responding to an abnormal timestamp which is more than a time threshold value from the current query time in the timestamp set, and responding to the change information corresponding to the abnormal timestamp again;
and deleting the information identifier of the change information corresponding to the abnormal timestamp from the information identifier set.
9. The method of claim 1, wherein the target change information is generated after any one of the subdata integrity audits in the content data is passed.
10. A content data update system, characterized in that the system comprises: a combiner, a timer and an actuator;
the merger is used for responding to the received target change information and acquiring a target information identifier of the target change information; in response to the target information identifier being distinct from information identifiers in an information identifier set, adding the target information identifier to the information identifier set; in response to receiving change information with the information identifier being the same as the target information identifier within a specified duration, not processing the change information; the target information identifier is used for identifying content data corresponding to the target change information; the target change information is generated corresponding to any subdata in the content data when the content data of the production end is updated; the target change information is used for triggering the updating of the content data of the consuming end;
the timer is used for setting the specified duration; responding to the end of the specified duration, and adding a delay message generated according to the target change information to a delay queue for consumption by the executor;
and the executor is used for updating the content data of the consuming end according to the delay message.
11. A content data update apparatus, characterized in that the apparatus comprises:
the identification acquisition module is used for responding to the received target change information and acquiring a target information identification of the target change information, wherein the target information identification is used for identifying content data corresponding to the target change information; the target change information is generated corresponding to any subdata in the content data when the content data of the production end is updated; the target change information is used for triggering the updating of the content data of the consuming end;
an identifier adding module, configured to add the target information identifier to an information identifier set in response to the target information identifier being different from information identifiers in the information identifier set, where the information identifiers in the information identifier set are non-duplicative;
the information processing module is used for responding to the change information with the information identification being the same as the target information identification received within a specified time length and not processing the change information;
and the updating module is used for responding to the end of the specified duration and updating the content data of the consuming end according to the target information identification.
12. A computer device comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement a content data update method according to any one of claims 1 to 9.
13. A computer-readable storage medium, having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement the content data update method according to any one of claims 1 to 9.
CN202010698068.7A 2020-07-20 2020-07-20 Content data updating method, device, computer equipment and storage medium Active CN111831954B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010698068.7A CN111831954B (en) 2020-07-20 2020-07-20 Content data updating method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010698068.7A CN111831954B (en) 2020-07-20 2020-07-20 Content data updating method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111831954A true CN111831954A (en) 2020-10-27
CN111831954B CN111831954B (en) 2023-11-03

Family

ID=72923680

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010698068.7A Active CN111831954B (en) 2020-07-20 2020-07-20 Content data updating method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111831954B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764951A (en) * 2021-01-27 2021-05-07 广州方硅信息技术有限公司 Message broadcasting method and device, electronic equipment and storage medium
CN115002507A (en) * 2022-07-29 2022-09-02 飞狐信息技术(天津)有限公司 Video data updating method, device, equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140189888A1 (en) * 2012-12-29 2014-07-03 Cloudcar, Inc. Secure data container for an ambient intelligent environment
CN109802933A (en) * 2018-06-07 2019-05-24 绿佳康(广东)科技有限公司 Resource optional method and device
CN110032459A (en) * 2019-04-22 2019-07-19 深圳乐信软件技术有限公司 Message queue configuration method, device, computer equipment and storage medium
WO2020015186A1 (en) * 2018-07-19 2020-01-23 平安科技(深圳)有限公司 Method and apparatus for real-time update of page data and electronic device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140189888A1 (en) * 2012-12-29 2014-07-03 Cloudcar, Inc. Secure data container for an ambient intelligent environment
CN109802933A (en) * 2018-06-07 2019-05-24 绿佳康(广东)科技有限公司 Resource optional method and device
WO2020015186A1 (en) * 2018-07-19 2020-01-23 平安科技(深圳)有限公司 Method and apparatus for real-time update of page data and electronic device
CN110032459A (en) * 2019-04-22 2019-07-19 深圳乐信软件技术有限公司 Message queue configuration method, device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
于翔;叶德建;: "一种基于云的应用层容错机制设计与实现", 微型电脑应用, no. 02 *
袁震;: "基于消息中间件的数据同步更新方法", 兵工自动化, no. 07 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764951A (en) * 2021-01-27 2021-05-07 广州方硅信息技术有限公司 Message broadcasting method and device, electronic equipment and storage medium
CN115002507A (en) * 2022-07-29 2022-09-02 飞狐信息技术(天津)有限公司 Video data updating method, device, equipment and readable storage medium

Also Published As

Publication number Publication date
CN111831954B (en) 2023-11-03

Similar Documents

Publication Publication Date Title
WO2021180025A1 (en) Message processing method and apparatus, electronic device and medium
CN112131237B (en) Data synchronization method, device, equipment and computer readable medium
CN112507029B (en) Data processing system and data real-time processing method
CN108965383B (en) File synchronization method and device, computer equipment and storage medium
CN110650164B (en) File uploading method and device, terminal and computer storage medium
CN108228322B (en) Distributed link tracking and analyzing method, server and global scheduler
US9652307B1 (en) Event system for a distributed fabric
CN111831954B (en) Content data updating method, device, computer equipment and storage medium
CN108762984B (en) Method and device for continuous data backup
CN109451078B (en) Transaction processing method and device under distributed architecture
CN112559475A (en) Data real-time capturing and transmitting method and system
US11930292B2 (en) Device state monitoring method and apparatus
CN109697112B (en) Distributed intensive one-stop operating system and implementation method
CN112865927B (en) Message delivery verification method, device, computer equipment and storage medium
CN112650755A (en) Data storage method, method for querying data, database and readable medium
CN112053707B (en) Recording method and device for multimedia equipment, storage medium and electronic device
US11386043B2 (en) Method, device, and computer program product for managing snapshot in application environment
CN115114316A (en) Processing method, device, cluster and storage medium for high-concurrency data
CN112749142A (en) Handle management method and system
CN113297166B (en) Data processing system, method and device
WO2022042514A1 (en) Metadata synchronization method and apparatus
CN113472469B (en) Data synchronization method, device, equipment and storage medium
CN113064950A (en) Data synchronization method, device, equipment and storage medium
CN116955287A (en) Data processing method, device, equipment and storage medium
CN117573770A (en) Method and system for incrementally synchronizing mass data from memory database to traditional database

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
GR01 Patent grant
GR01 Patent grant