CN110727895B - Sensitive word sending method and device, electronic equipment and storage medium - Google Patents

Sensitive word sending method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110727895B
CN110727895B CN201910955147.9A CN201910955147A CN110727895B CN 110727895 B CN110727895 B CN 110727895B CN 201910955147 A CN201910955147 A CN 201910955147A CN 110727895 B CN110727895 B CN 110727895B
Authority
CN
China
Prior art keywords
sensitive word
version
sensitive
rollback
sequence number
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.)
Active
Application number
CN201910955147.9A
Other languages
Chinese (zh)
Other versions
CN110727895A (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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201910955147.9A priority Critical patent/CN110727895B/en
Publication of CN110727895A publication Critical patent/CN110727895A/en
Application granted granted Critical
Publication of CN110727895B publication Critical patent/CN110727895B/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure relates to a method and an apparatus for sending sensitive words, an electronic device and a storage medium, and relates to the technical field of computers, and the method includes: the method comprises the steps of receiving a sensitive word acquisition request sent by a sensitive word request end, wherein the sensitive word acquisition request carries an existing version serial number, determining sending information used for sending to the sensitive word request end in the total sensitive words and the sensitive word updating records according to the existing version serial number, and sending the determined sending information to the sensitive word request end. Therefore, the scheme provided by the embodiment of the disclosure can improve the sending efficiency of sending the sensitive words.

Description

Sensitive word sending method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for sending a sensitive word, an electronic device, and a storage medium.
Background
Nowadays, the internet has been integrated into the life of people, and people can make public opinions, opinions and the like in the internet through application software, websites and the like. In order to prevent people from publishing inappropriate contents and bringing adverse effects to others, various application software, websites and the like generally carry out sensitive word limitation on the published contents. The sensitive words include words with sensitive political tendency, violence tendency, unhealthy color, and non-civilized words.
The sensitive words are usually stored in the server, the sensitive word request terminal sends a sensitive word acquisition request to the server to acquire the sensitive words, when a user releases content through application software, a website and the like, the application software, the website and the like can compare the content released by the user with the sensitive words stored in the sensitive word request terminal, and if the content released by the user is found to contain the sensitive words, the content can be shielded.
In the related art, the sensitive words are changed along with the change of the versions, and when the server sends the sensitive words to the sensitive word request terminal, all the latest sensitive words of the server are sent to the sensitive word request terminal. Therefore, when the sensitive words are sent each time, the sending data volume is large, and the sending efficiency is low.
Disclosure of Invention
The disclosure provides a sensitive word sending method, a sensitive word sending device, electronic equipment and a storage medium, which are used for improving sending efficiency of sending sensitive words.
According to a first aspect of the embodiments of the present disclosure, a sensitive word sending method is provided, including:
receiving a sensitive word acquisition request sent by a sensitive word request end, wherein the sensitive word acquisition request carries an existing version number, and the existing version number is the version number of an existing sensitive word of the sensitive word request end;
determining sending information used for sending to the sensitive word request terminal in a total sensitive word and a sensitive word updating record according to the existing version serial number, wherein the sensitive word updating record is used for recording the updating information of the sensitive words corresponding to the version serial numbers;
and sending the determined sending information to the sensitive word request terminal.
In an embodiment of the present disclosure, the determining, according to the existing version number, sending information used for sending to the sensitive word request end in the total sensitive words and the sensitive word update records includes:
determining the total sensitive words and the latest version serial numbers for updating the sensitive words as the sending information under the condition that the existing version serial numbers are wrong serial numbers or the existing version serial numbers represent that the sensitive word acquisition request is a first request;
determining a sensitive word update record located in an update range under the condition that the existing version number represents that the sensitive word is updated, and determining the determined sensitive word update record as the sending information, wherein the update range is as follows: a range from a next sequence number of the existing version sequence numbers to the latest version sequence number;
and under the condition that the existing version sequence number representation sensitive word is not updated, determining the latest version sequence number as the sending information.
In an embodiment of the present disclosure, the sensitive word update record is obtained by:
for an updated sensitive word, determining an identification of an update operation performed on the updated sensitive word;
determining a version serial number for updating the updated sensitive word based on a last version serial number for updating the sensitive word last time;
and storing an updating record for recording the corresponding relation among the updated sensitive words, the identification of the updating operation and the determined version sequence number.
In an embodiment of the present disclosure, the determining a version number for updating the updated sensitive word based on a last version number for updating the sensitive word last time includes:
and determining the version sequence number for updating the updated sensitive word according to the mode of increasing the version sequence number or decreasing the version sequence number on the basis of the last version sequence number.
In one embodiment of the present disclosure, the method further comprises:
determining a version sequence number rolled back by rolling back the sensitive word as a rolling back version sequence number;
determining the sensitive words with the version sequence numbers within the rollback range as rollback sensitive words, and determining the reverse operation of the updating operation represented by the identifier of the updating operation contained in the sensitive word updating record to which each rollback sensitive word belongs as the rollback operation, wherein the rollback range is as follows: a range from a next sequence number of the rollback version sequence number to a latest version sequence number;
performing a rollback operation on each rollback sensitive word;
determining a version sequence number for performing rollback processing on the sensitive word based on the latest version sequence number;
storing an update record representing a correspondence between the rollback sensitive word, the identification of the rollback operation, and the determined version number.
According to a second aspect of the embodiments of the present disclosure, there is provided a sensitive word transmitting apparatus, the apparatus including:
the device comprises a request receiving module, a sensitive word obtaining module and a sensitive word obtaining module, wherein the request receiving module is configured to receive a sensitive word obtaining request sent by a sensitive word requesting terminal, the sensitive word obtaining request carries an existing version serial number, and the existing version serial number is the version serial number of the existing sensitive word of the sensitive word requesting terminal;
the information determining module is configured to determine sending information used for sending to the sensitive word requesting terminal in a full amount of sensitive words and sensitive word updating records according to the existing version numbers, wherein the sensitive word updating records are used for recording the updating information of the sensitive words corresponding to the version numbers;
an information sending module configured to send the determined sending information to the sensitive word requesting terminal.
In an embodiment of the disclosure, the information determining module is specifically configured to:
determining the full sensitive words and the latest version serial numbers for updating the sensitive words as the sending information under the condition that the existing version serial numbers are error serial numbers or the existing version serial numbers represent that the sensitive word acquisition request is a first request;
determining a sensitive word update record located in an update range under the condition that the existing version number represents that the sensitive word is updated, and determining the determined sensitive word update record as the sending information, wherein the update range is as follows: a range from a next sequence number of the existing version sequence numbers to the latest version sequence number;
and under the condition that the existing version sequence number representation sensitive word is not updated, determining the latest version sequence number as the sending information.
In one embodiment of the present disclosure, the apparatus further comprises: a record obtaining module for obtaining an update record of a sensitive word, the record obtaining module including:
an operation identification determination unit configured to determine, for an updated sensitive word, an identification of an update operation performed on the updated sensitive word;
the version sequence number determining unit is configured to determine a version sequence number for updating the updated sensitive word based on a last version sequence number for updating the sensitive word last time;
a record storage unit configured to store an update record for recording a correspondence relationship between the updated sensitive word, the identification of the update operation, and the determined version number.
In an embodiment of the present disclosure, the version number determining unit is specifically configured to:
and determining the version sequence number for updating the updated sensitive word according to the mode of increasing the version sequence number or decreasing the version sequence number on the basis of the last version sequence number.
In one embodiment of the present disclosure, the apparatus further comprises: a sensitive word rollback module to rollback sensitive words, the sensitive word rollback module comprising:
the rollback sequence number determining unit is configured to determine a version sequence number to which the sensitive word is rolled back as a rollback version sequence number;
a rollback information determining unit, configured to determine, as rollback sensitive words, the sensitive words whose version numbers are located in a rollback range, and determine, as rollback operations, reverse operations of the update operations represented by the identifiers of the update operations included in the sensitive word update record to which each rollback sensitive word belongs, where the rollback range is: a range from a next sequence number of the rollback version sequence number to a latest version sequence number;
the sensitive word rollback unit is configured to execute rollback operation on each rollback sensitive word, determine a version serial number for performing rollback processing on the sensitive word based on the latest version serial number, and store an update record representing the corresponding relationship among the rollback sensitive words, the identifiers of the rollback operation, and the determined version serial numbers.
According to a third aspect of an embodiment of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the sensitive word transmitting method according to any one of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium, wherein instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the sensitive word transmitting method according to any one of the first aspects.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
as can be seen from the above embodiments, when a sensitive word is sent by applying the sensitive word sending scheme provided by the present disclosure, a sensitive word obtaining request sent by a sensitive word requesting end is received first, sending information used for sending to the sensitive word requesting end is determined in a total number of sensitive words and sensitive word update records according to an existing version number, and the determined sending information is sent to the sensitive word requesting end. Therefore, when the sensitive words are sent to the sensitive word request terminal, the information sent to the sensitive word request terminal is determined based on the version serial numbers of the sensitive words existing in the sensitive word request terminal, and all the sensitive words do not need to be sent to the sensitive word request terminal directly, so that the sent data volume is small. By applying the scheme, the sending efficiency of sending the sensitive words can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow diagram illustrating a method for transmitting sensitive words, according to an example embodiment.
Fig. 2 is a flowchart illustrating a sensitive word update record obtaining method according to an example embodiment.
FIG. 3 is a flowchart illustrating a sensitive word rollback method in accordance with an exemplary embodiment.
Fig. 4 is a schematic diagram illustrating a structure of a sensitive word transmitting apparatus according to an exemplary embodiment.
Fig. 5 is a schematic structural diagram of an electronic device according to an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a sensitive word sending method according to an exemplary embodiment, where the method is applied to a server.
The server is used for providing sensitive word services, including sensitive word preparation, sensitive word updating, sensitive word storage, sensitive word sending and the like. The server may be implemented by one or more physical machines, and specifically, the physical machine may be a server, a desktop computer, a notebook computer, or the like.
As shown in fig. 1, the sensitive word transmitting method includes the following steps 101 to 103.
Step 101, receiving a sensitive word acquisition request sent by a sensitive word request terminal.
The sensitive word acquiring request carries an existing version number, and the existing version number is as follows: the version number of the existing sensitive word at the sensitive word request end. The sensitive word request terminal can be a website, a software client and the like which need sensitive word service.
And after the sensitive words stored by the server are updated each time, the sensitive words are changed. Each version number corresponds to each update to a sensitive word. Therefore, the version number can be used to indicate an update sequence for updating sensitive words in the server. For example, the version number may be a number "1, 2, 3, 4, 5 … …", or may be an update date "20180701, 20180705, 20180715 … …", which is not limited in this disclosure.
After the sensitive word request end requests the sensitive word, the sensitive word request end receives the sensitive word sent by the server end and the version number corresponding to the sensitive word, and under the condition that the sensitive word request end has the version number corresponding to the sensitive word and the sensitive word sent by the server end, the version number can be the version number corresponding to the sensitive word already sent by the sensitive word request end. In the case that the sensitive word request end never requests the sensitive word from the server end, the sensitive word request end does not have the sensitive word, and does not have the version number corresponding to the sensitive word, in this case, the existing version number may be null information, or may be a preset number, for example, "0", that characterizes that the sensitive word request end does not have the sensitive word.
And 102, determining sending information used for sending to the sensitive word request terminal in the total sensitive words and the sensitive word updating records according to the existing version serial numbers.
The full sensitive words are all the sensitive words stored by the server.
The sensitive word update record is used for recording the update information of the sensitive words corresponding to the version numbers. Specifically, each time the sensitive word at the server is updated, one sensitive word at the server may be updated, or multiple sensitive words at the server may be updated, for example, multiple sensitive words may be added and/or multiple sensitive words may be deleted. The sensitive word update record may record update information for updating the sensitive word each time, and the update information may include update time, an updated sensitive word, an identifier of an operation performed on each updated sensitive word, and a version number corresponding to the updated sensitive word.
The updated sensitive words comprise sensitive words which are added and/or deleted at the server side when the sensitive words stored at the server side are updated. The addition operation or the deletion operation performed on the updated sensitive word is the updating operation.
In one embodiment of the present disclosure, the identifier of the update operation may be an english letter, for example, an add may be used to indicate an add update operation, and a delete may be used to indicate a delete update operation.
In an embodiment of the present disclosure, the identifier of the update operation may also be an arabic numeral, for example, the update operation may be added by "1", and deleted by "0".
And 103, sending the determined sending information to the sensitive word request terminal.
Therefore, when the sensitive words are sent to the sensitive word request end, the whole sensitive words do not need to be sent to the sensitive word request end every time, and only the sensitive word update records in the update range need to be sent to the sensitive word request end, so that the sent data volume is reduced, the bandwidth resources can be effectively saved, and the sending efficiency is improved.
For step 102, in an embodiment of the present disclosure, when the existing version number is an error number or the existing version number indicates that the sensitive word obtaining request is a first request, the full sensitive word and the latest version number for updating the sensitive word may be determined as the sending information.
Under the condition that the sensitive word acquisition request is a first request, the situation shows that no sensitive word exists in the current sensitive word request end, so that the whole sensitive words need to be sent to the sensitive word request end; and under the condition that the existing version serial number is the wrong serial number, the sensitive words of the sensitive word request end are wrong, and in order to ensure that the sensitive word request end can receive correct, complete and latest sensitive words, the full sensitive words and the latest version serial number stored by the server end are sent to the sensitive word request end.
In an embodiment of the present disclosure, whether the sensitive word obtaining request is a first request may be determined according to an existing version number. Specifically, under the condition that the existing version number is the preset initial number, the sensitive word acquisition request is considered as a first request. For example, assuming that the preset initial sequence number is "0", the sensitive word acquisition request is determined as the first request when the existing version sequence number is also "0".
In an embodiment of the present disclosure, in a case that information of an existing version number carried in a sensitive word acquisition request is null information, the sensitive word acquisition request is also determined as a first request.
In one embodiment of the present disclosure, the existing version number may be determined to be an error number in the case where the existing version number is higher than the latest version number. And the latest version serial number is the version serial number which is updated for the sensitive word at the latest time. For example, if the existing version number is "102" and the latest version number is "100", the existing version number is considered to be an error number.
In an embodiment of the present disclosure, when the existing version number carried by the sensitive word obtaining request is a messy code, the existing version number may also be determined as an error number.
With respect to step 102, in an embodiment of the present disclosure, in a case that the existing version number indicates that the sensitive word has an update, the update record of the sensitive word located in the update range may be determined, and the determined update record of the sensitive word is determined as the sending information.
Wherein, the updating range is as follows: the range from the next sequence number of the existing version sequence numbers to the latest version sequence number. For example, when the existing version number is "99" and the latest version number is "101", the next number of the existing version number is "100", and therefore, the update range is: the version number ranges from "100" to "101".
For example, as shown in table 1 below, the updated sensitive word and the sequence number of the update operation corresponding to each updated sensitive word when the version numbers are "100" and "101", respectively, in the table may be determined as the transmission information when the existing version number is "99" and the latest version number is "101".
TABLE 1
Updated sensitive words Operation sequence number Version number
Word1 Add 100
Word2 Add 100
Word3 Add 100
Word4 Add 100
Word5 Add 100
Word6 Add 101
Word4 Delete 101
With respect to step 102, in an embodiment of the present disclosure, in a case that the existing version number indicates that the sensitive word is not updated, the latest version number may be determined as the sending information.
In an embodiment of the present disclosure, when the existing version number is equal to the latest version number, it indicates that the server does not update the sensitive word until the sensitive word is requested by the sensitive word request terminal last time, so that the sensitive word existing at the sensitive word request terminal is the latest sensitive word, and the sensitive word does not need to be sent to the sensitive word request terminal. And the latest version serial number is sent to the sensitive word request end, so that the purpose is to inform the sensitive word request end that the current sensitive word is the latest sensitive word, and the misunderstanding that the request is wrong is avoided.
For example, when the sensitive word request end receives the latest version serial number sent by the server end, it can be known that the existing sensitive word is the latest sensitive word; when the sensitive word request end does not receive any information, the sensitive word request end may be down for the service end, request sending errors, server connection disconnection and the like.
As for the step 102, in an embodiment of the present disclosure, the time when the sensitive word request end obtains the sensitive word last time may also be determined according to the existing version number, all records updated on the sensitive word since last update are determined in the sensitive word update record, and the determined sensitive word update record is used as the sending information.
As can be seen from the above embodiments, when a sensitive word is sent by applying the sensitive word sending scheme provided by the present disclosure, a sensitive word obtaining request sent by a sensitive word requesting end is received first, sending information used for sending to the sensitive word requesting end is determined in a total number of sensitive words and sensitive word update records according to an existing version number, and the determined sending information is sent to the sensitive word requesting end. Therefore, when the sensitive words are sent to the sensitive word request end, the information sent to the sensitive word request end is determined based on the version serial numbers of the existing sensitive words of the sensitive word request end, and all the sensitive words do not need to be sent to the sensitive word request end directly, so that the sent data volume is small. By applying the scheme, the sending efficiency of sending the sensitive words can be improved.
Fig. 2 is a flowchart illustrating a sensitive word update record obtaining method, which is applied in a server according to an exemplary embodiment. As shown in fig. 2, the method for obtaining the updated record of the sensitive word includes the following steps 104 to 106.
And 104, for the updated sensitive word, determining the identification of the updating operation performed on the updated sensitive word.
For each updated sensitive word, the update operation performed on the updated sensitive word includes deleting or adding, that is, each updated sensitive word corresponds to an identification of an update operation.
And 105, determining the version serial number for updating the updated sensitive word based on the last version serial number for updating the sensitive word last time.
Specifically, each time a sensitive word is updated, the version number of the update is recorded. When the version number is determined, the last version number updated last time is obtained first, and then the version number for updating the sensitive word this time is determined according to the arrangement mode of the version numbers.
In one embodiment of the present disclosure, the version number for updating the updated sensitive word may be determined in a manner of increasing the version number or decreasing the version number based on the last version number.
For example, when the version number is a numeric number, assuming that the version number of the sensitive word updated last time is "100", the version number of the sensitive word updated this time can be determined to be "101" in such a manner that the number is incremented. This facilitates a clear representation of the update sequence between different version numbers.
In an embodiment of the present disclosure, the version number of the updated sensitive word may be determined according to the version number of the sensitive word updated last time and the updated quantity of the sensitive word updated this time. Specifically, under the condition that the quantity of the updated sensitive words is greater than the preset threshold, the range of the current update is considered to be larger, and the updated sensitive words belong to updates different from the last update, and the version number of the updated sensitive words can be determined in a manner of increasing the number incrementally; and under the condition that the updated sensitive word quantity is smaller than the preset threshold value, the current update can be used as a sub-update of the last update, and the version number of the current update is determined according to the form of adding decimal points and numbers behind the version number of the last update.
For example, if the version number of the sensitive word updated last time is "100", the preset threshold is 50, and if the updated sensitive word amount of the current update is 80, the range of the current update is considered to be large, and the updated sensitive word belongs to an update different from the previous update, it may be determined that the version number of the current sensitive word updated is "101"; assuming that the updated sensitive word quantity of the current update is 30, the current update is taken as the sub-update of the last update, and the version number of the current update on the updated sensitive word can be determined to be "100.1".
And 106, storing an updating record for recording the corresponding relation among the updated sensitive words, the identification of the updating operation and the determined version sequence number.
In an embodiment of the present disclosure, each updated sensitive word and the sequence number and version number of the update operation corresponding to the sensitive word may be stored as a record, that is, one record represents a corresponding relationship between one updated sensitive word and the sequence number and version number of the update operation corresponding to the updated sensitive word. For example, as shown in table 2 below, "Word 1", "Word 2", etc. in the table represent updated sensitive words each time the sensitive words are updated, "add" and "delete" represent the sequence number of the update operation performed on each updated sensitive Word, respectively, and "100" and "102" represent the version sequence numbers updated more times. Each action in the table is an updated sensitive word and an updated record of the corresponding relationship between the sequence number and the version sequence number of the updating operation of the sensitive word.
TABLE 2
Updated sensitive words Operation mark Version number
Word1 Add 100
Word2 Add 100
Word3 Delete 102
Word4 Delete 102
In an embodiment of the present disclosure, the corresponding relationship between the updated sensitive word that executes the same update operation in each update and the sequence number and version number of the corresponding update operation may also be stored as a record. For example, as shown in table 3 below, "Word 1" and "Word 2" in the table are updated sensitive words on which the Add operation is also performed in the update represented by the version number 100, and therefore, the correspondence between "Word 1" and "Word 2" and the sequence number "Add" and version number "101" of the update operation is stored as one record.
TABLE 3
Figure BDA0002227020650000101
Therefore, when the sensitive words stored in the server are updated, the sensitive words are not only added or deleted on the basis that the sensitive words are stored in the server, so that the sensitive words of the server are updated, but also the sensitive word updating records for updating the sensitive words every time are stored.
It should be noted that, there is no precedence relationship between the execution sequence of the steps 104 to 106 and the steps 101 to 103, and the steps 104 to 106 may be executed before or after any one of the steps 101 to 103.
As can be seen from the above embodiments, when obtaining a sensitive word update record by applying the sensitive word update record obtaining scheme provided by the present disclosure, first, an identifier of an updated sensitive word and an update operation performed on the updated sensitive word are determined, a version number for updating the updated sensitive word is determined according to a version number for updating the sensitive word last time, and an update record indicating a correspondence relationship between the updated sensitive word, the identifier of the update operation, and the determined version number is stored. Therefore, by applying the scheme, the storage of the update records of the sensitive words can be realized. Therefore, as the sensitive words stored by the server are updated continuously, various application software, websites and even the server can know the updating condition of the sensitive words stored by the server.
Fig. 3 is a flowchart illustrating a sensitive word rollback method, which is applied to a server according to an exemplary embodiment. As shown in fig. 3, the sensitive word rollback method includes the following steps 107 to 111.
And step 107, determining the version sequence number to which the sensitive word is rolled back by the rolling back process as the rolling back version sequence number.
For example, if the version number of the sensitive word stored by the current server is "101", then "101" is the latest version number. If it is desired to roll back a sensitive word to a sensitive word having a version number corresponding to "100", then "100" is the rolled back version number.
Specifically, the rollback version number may be set manually, or a rollback version number interval may be set in advance, and the version number of the rollback node that is separated from the latest version number by the rollback version number interval may be used as the rollback version number. The rolling version sequence number interval may be set according to an update cycle, for example, from the first update, 5 updates are performed at an interval as a rolling version sequence number interval.
And 108, determining the sensitive words with the version numbers within the rollback range as the rollback sensitive words, and determining the reverse operation of the updating operation represented by the identification of the updating operation contained in the updating record of the sensitive words to which each rollback sensitive word belongs as the rollback operation.
Wherein, the rollback range is: the range from the next sequence number of the rollback version sequence number to the latest version sequence number. For example, in the case where the rollback version number is "100" and the latest version number is "101", the next number of the rollback version number is "101", and thus the rollback range is the range of the sensitive word update record with the version number of 101.
Under the condition that the updating operation represented by the identification of the updating operation contained in the updating record of the sensitive word to which the rollback sensitive word belongs is the adding operation, the deleting operation is taken as the rollback operation because the reverse operation of the adding operation is the deleting operation; and in the case that the update operation represented by the identification of the update operation contained in the sensitive word update record to which the rollback sensitive word belongs is a deletion operation, the addition operation is taken as the rollback operation because the reverse operation of the deletion operation is an addition operation.
At step 109, a rollback operation is performed on each rollback sensitive word.
Specifically, the server stores the full-amount sensitive words, finds the rollback sensitive words from the full-amount sensitive words, and performs rollback operation on the found rollback sensitive words.
And step 110, determining the version sequence number for rolling back the sensitive word based on the latest version sequence number.
In one embodiment of the present disclosure, the version sequence number for performing rollback processing on the sensitive word may be determined according to the latest version sequence number in a manner of increasing the sequence number or decreasing the sequence number. For example, when the version number is a numeric number, assuming that the latest version number is "100", the version number for which the rollback processing of the sensitive word is performed this time can be determined to be "101" in such a manner that the number is incremented.
Since the rollback processing is also sensitive word updating for the sensitive words stored by the server, the rollback operation is also recorded as an updating operation, so that the updating record of the sensitive words can be conveniently tracked.
And step 111, storing an update record representing the corresponding relation among the rollback sensitive words, the identifiers of the rollback operation and the determined version serial numbers.
For example, referring to table 3 above, when an update error occurs in the update with version number "101" and it is desired to roll back the sensitive Word to the sensitive Word with version number "100", then "100" is determined as the rolled back version number, and the rolling back range is the range of the update record of the sensitive Word with version number 101, so that "Word 6" and "Word 4" are determined as the rolled back sensitive Word, the update sequence number of the rolled back sensitive Word "Word 6" in the update with version number "101" is "add", and the corresponding update operation is an add operation, then the rolling back operation of "Word 6" is a delete operation, and similarly, the rolling back operation corresponding to the rolled back sensitive Word "Word 4" is an add operation, find "Word 6" in the full sensitive Word, delete "Word 6", and add "Word 4" in the full sensitive Word; this rollback operation is recorded as shown in table 4 below.
TABLE 4
Figure BDA0002227020650000111
Figure BDA0002227020650000121
The scheme provided by the embodiment can conveniently and quickly return the current sensitive word to the sensitive word corresponding to the previous version number, so that when the matching of the sensitive word is wrong, the sensitive word can be conveniently returned to the place before the mistake is made.
It should be noted that, there is no precedence relationship between the execution sequence of the above steps 107 to 111 and the above steps 104 to 106, and the above steps 107 to 111 may be executed before or after any step of the steps 104 to 106.
Fig. 4 is a schematic structural diagram of a sensitive word sending apparatus according to an exemplary embodiment, which is applied to a server and includes:
a request receiving module 401 configured to receive a sensitive word obtaining request sent by a sensitive word requesting end, where the sensitive word obtaining request carries an existing version number, and the existing version number is a version number of an existing sensitive word of the sensitive word requesting end;
an information determining module 402, configured to determine, according to the existing version number, sending information used for sending to the sensitive word request end in a total sensitive word and a sensitive word update record, where the sensitive word update record is used to record update information of a sensitive word corresponding to each version number;
an information sending module 403 configured to send the determined sending information to the sensitive word requesting end.
In an embodiment of the present disclosure, the information determining module 402 is specifically configured to:
determining the full sensitive words and the latest version serial numbers for updating the sensitive words as the sending information under the condition that the existing version serial numbers are error serial numbers or the existing version serial numbers represent that the sensitive word acquisition request is a first request;
determining a sensitive word update record located in an update range under the condition that the existing version number represents that the sensitive word is updated, and determining the determined sensitive word update record as the sending information, wherein the update range is as follows: a range from a next sequence number of the existing version sequence numbers to the latest version sequence number;
and under the condition that the existing version sequence number representation sensitive word is not updated, determining the latest version sequence number as the sending information.
In one embodiment of the present disclosure, the apparatus further comprises: a record obtaining module for obtaining an update record of a sensitive word, the record obtaining module including:
an operation identification determination unit configured to determine, for an updated sensitive word, an identification of an update operation performed on the updated sensitive word;
the version sequence number determining unit is configured to determine a version sequence number for updating the updated sensitive word based on a last version sequence number for updating the sensitive word last time;
a record storage unit configured to store an update record for recording a correspondence between the updated sensitive word, an identification of an update operation, and the determined version number.
In an embodiment of the present disclosure, the version number determining unit is specifically configured to:
and determining the version sequence number for updating the updated sensitive word according to the mode of increasing the version sequence number or decreasing the version sequence number on the basis of the last version sequence number.
In one embodiment of the present disclosure, the apparatus further comprises: a sensitive word rollback module to rollback sensitive words, the sensitive word rollback module comprising:
the rollback sequence number determining unit is configured to determine a version sequence number to which the sensitive word is rolled back as a rollback version sequence number;
the rollback information determining unit is configured to determine the sensitive words with the version numbers within the rollback range as rollback sensitive words, and determine a reverse operation of the update operation represented by the identifier of the update operation included in the update record of the sensitive word to which each rollback sensitive word belongs, as the rollback operation, where the rollback range is: a range from a next sequence number of the rollback version sequence number to a latest version sequence number;
the sensitive word rollback unit is configured to execute rollback operation on each rollback sensitive word, determine a version serial number for performing rollback processing on the sensitive word based on the latest version serial number, and store an update record representing the corresponding relationship among the rollback sensitive words, the identifiers of the rollback operation, and the determined version serial numbers.
As can be seen from the above embodiments, when a sensitive word is sent by using the sensitive word sending scheme provided by the present disclosure, a sensitive word obtaining request sent by a sensitive word requesting end is received first, sending information used for sending to the sensitive word requesting end is determined in the total sensitive words and the sensitive word update records according to the existing version number, and the determined sending information is sent to the sensitive word requesting end. Therefore, when the sensitive words are sent to the sensitive word request end, the information sent to the sensitive word request end is determined based on the version serial numbers of the existing sensitive words of the sensitive word request end, and all the sensitive words do not need to be sent to the sensitive word request end directly, so that the sent data volume is small. By applying the scheme, the sending efficiency of sending the sensitive words can be improved.
It should be noted that there is no necessary triggering sequence among the sensitive word rollback module, the record acquisition module, and the modules 401 to 403, and the sensitive word rollback module and the record acquisition module may be triggered in any one of the modules 401 to 403 in sequence.
Fig. 5 is a block diagram of an electronic device according to an exemplary embodiment, which is applied to a server. Referring to fig. 5, the electronic device includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory 503 are communicated with each other via the communication bus 504,
a memory 503 for storing a computer program;
the processor 501 is configured to implement the sensitive word sending method provided by the present disclosure when executing the program stored in the memory 503.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus. The communication interface is used for communication between the electronic equipment and other equipment. The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment provided by the present disclosure, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the sensitive word sending methods.
In yet another embodiment provided by the present disclosure, a computer program product containing instructions is further provided, which when executed on a computer, causes the computer to execute any one of the sensitive word sending methods in the above embodiments.
It can be seen that, when the electronic device provided by the above embodiment is used to send a sensitive word, execute the computer program stored in the computer-readable storage medium provided by the above embodiment to send a sensitive word, and execute the computer program product provided by the above embodiment on a computer to send a sensitive word, first receive a sensitive word acquisition request sent by a sensitive word request end, determine sending information used for sending to the sensitive word request end in a full sensitive word and sensitive word update record according to an existing version number, and send the determined sending information to the sensitive word request end. Therefore, when the sensitive words are sent to the sensitive word request terminal, the information sent to the sensitive word request terminal is determined based on the version serial numbers of the sensitive words existing in the sensitive word request terminal, and all the sensitive words do not need to be sent to the sensitive word request terminal directly, so that the sent data volume is small.
Compared with the prior art, the electronic device, the readable storage medium and the computer program product provided by the embodiments of the present invention can quickly and accurately implement the sensitive word sending method provided by the embodiments of the present invention, and by applying the above-mentioned scheme, the sending efficiency of sending the sensitive word can be improved.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to be performed in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, apparatus embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are described with relative simplicity as they are substantially similar to method embodiments, where relevant only as described in portions of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for sending a sensitive word, the method comprising:
receiving a sensitive word acquisition request sent by a sensitive word request end, wherein the sensitive word acquisition request carries an existing version number, and the existing version number is: the version sequence number of the existing sensitive word at the sensitive word request end;
determining sending information used for sending to the sensitive word request terminal in a total sensitive word and a sensitive word updating record according to the existing version sequence number, wherein the sensitive word updating record is used for: recording the updating information of the sensitive words corresponding to each version number;
sending the determined sending information to the sensitive word request terminal;
the determining, according to the existing version number, sending information used for sending to the sensitive word request end in the total sensitive words and the sensitive word update records includes:
determining the full sensitive words and the latest version serial numbers for updating the sensitive words as the sending information under the condition that the existing version serial numbers are error serial numbers or the existing version serial numbers represent that the sensitive word acquisition request is a first request;
determining a sensitive word update record located in an update range under the condition that the existing version number represents that the sensitive word is updated, and determining the determined sensitive word update record as the sending information, wherein the update range is as follows: a range from a next sequence number of the existing version sequence numbers to the latest version sequence number;
and under the condition that the existing version sequence number representation sensitive word is not updated, determining the latest version sequence number as the sending information.
2. The method of claim 1, wherein the sensitive word update record is obtained by:
for an updated sensitive word, determining an identification of an update operation performed on the updated sensitive word;
determining a version serial number for updating the updated sensitive word based on a last version serial number for updating the sensitive word last time;
and storing an updating record for recording the corresponding relation among the updated sensitive words, the identification of the updating operation and the determined version sequence number.
3. The method of claim 2, wherein determining the version number of the updated sensitive word based on the last version number of the last update of the sensitive word comprises:
and determining the version sequence number for updating the updated sensitive word according to the mode of increasing the version sequence number or decreasing the version sequence number on the basis of the last version sequence number.
4. The method of claim 2, further comprising:
determining a version sequence number rolled back by rolling back the sensitive word as a rolled back version sequence number;
determining the sensitive words with version numbers within a rollback range as rollback sensitive words, and determining the reverse operation of the update operation represented by the identifier of the update operation included in the sensitive word update record to which each rollback sensitive word belongs as the rollback operation, wherein the rollback range is as follows: a range from a next sequence number of the rollback version sequence number to a latest version sequence number;
performing a rollback operation on each rollback sensitive word;
determining a version sequence number for performing rollback processing on the sensitive word based on the latest version sequence number;
storing an update record representing a correspondence between the rollback sensitive word, the identity of the rollback operation, and the determined version number.
5. An apparatus for transmitting a sensitive word, the apparatus comprising:
the device comprises a request receiving module, a sensitive word obtaining module and a sensitive word obtaining module, wherein the request receiving module is configured to receive a sensitive word obtaining request sent by a sensitive word requesting terminal, the sensitive word obtaining request carries an existing version serial number, and the existing version serial number is the version serial number of the existing sensitive word of the sensitive word requesting terminal;
the information determining module is configured to determine sending information used for sending to the sensitive word requesting terminal in a full amount of sensitive words and sensitive word updating records according to the existing version numbers, wherein the sensitive word updating records are used for recording the updating information of the sensitive words corresponding to the version numbers;
an information sending module configured to send the determined sending information to the sensitive word requesting terminal;
the information determination module is specifically configured to:
determining the full sensitive words and the latest version serial numbers for updating the sensitive words as the sending information under the condition that the existing version serial numbers are error serial numbers or the existing version serial numbers represent that the sensitive word acquisition request is a first request;
under the condition that the existing version number represents that the sensitive word is updated, determining a sensitive word update record located in an update range, and determining the determined sensitive word update record as the sending information, wherein the update range is as follows: a range from a next sequence number of the existing version sequence numbers to the latest version sequence number;
and under the condition that the existing version sequence number representation sensitive word is not updated, determining the latest version sequence number as the sending information.
6. The apparatus of claim 5, further comprising: a record obtaining module for obtaining an update record of a sensitive word, the record obtaining module including:
an operation identification determination unit configured to determine, for an updated sensitive word, an identification of an update operation performed on the updated sensitive word;
the version sequence number determining unit is configured to determine a version sequence number for updating the updated sensitive word based on a last version sequence number for updating the sensitive word last time;
a record storage unit configured to store an update record for recording a correspondence relationship between the updated sensitive word, the identification of the update operation, and the determined version number.
7. The apparatus according to claim 6, wherein the version number determining unit is specifically configured to:
and determining the version sequence number for updating the updated sensitive word according to the mode of increasing the version sequence number or decreasing the version sequence number on the basis of the last version sequence number.
8. The apparatus of claim 6, further comprising: a sensitive word rollback module to rollback sensitive words, the sensitive word rollback module comprising:
the rollback sequence number determining unit is configured to determine a version sequence number to which the sensitive word is rolled back as a rollback version sequence number;
a rollback information determining unit, configured to determine, as rollback sensitive words, the sensitive words whose version numbers are within a rollback range, and determine, as rollback operations, a reverse operation of the update operations represented by the identifiers of the update operations included in the sensitive word update record to which each rollback sensitive word belongs, where the rollback range is: a range from a next sequence number of the rollback version sequence number to a latest version sequence number;
the sensitive word rollback unit is configured to execute rollback operation on each rollback sensitive word, determine a version serial number for performing rollback processing on the sensitive word based on the latest version serial number, and store an update record representing the corresponding relationship among the rollback sensitive words, the identifiers of the rollback operation, and the determined version serial numbers.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the sensitive word transmitting method of any one of claims 1 to 4.
10. A storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the sensitive word sending method of any one of claims 1 to 4.
CN201910955147.9A 2019-10-09 2019-10-09 Sensitive word sending method and device, electronic equipment and storage medium Active CN110727895B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910955147.9A CN110727895B (en) 2019-10-09 2019-10-09 Sensitive word sending method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910955147.9A CN110727895B (en) 2019-10-09 2019-10-09 Sensitive word sending method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110727895A CN110727895A (en) 2020-01-24
CN110727895B true CN110727895B (en) 2022-07-22

Family

ID=69219764

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910955147.9A Active CN110727895B (en) 2019-10-09 2019-10-09 Sensitive word sending method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110727895B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112380411B (en) * 2020-11-10 2024-01-09 北京达佳互联信息技术有限公司 Sensitive word processing method, device, electronic equipment, system and storage medium
CN114461614B (en) * 2022-04-12 2022-06-28 北京安华金和科技有限公司 Sensitive data identification processing method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514417A (en) * 2012-06-25 2014-01-15 中兴通讯股份有限公司 Method, device and system for updating version information of electronic label
CN104182252A (en) * 2014-08-13 2014-12-03 墨仕(厦门)电子商务有限公司 App version incremental updating method
CN106326100A (en) * 2015-06-30 2017-01-11 中兴通讯股份有限公司 Software automatic testing method and device
CN107729041A (en) * 2017-07-26 2018-02-23 上海壹账通金融科技有限公司 The hot update method of application program, device, terminal and storage medium
CN110058873A (en) * 2019-03-12 2019-07-26 天津五八到家科技有限公司 Application page update method, device, equipment and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228620A (en) * 2016-12-14 2018-06-29 北京搜狗科技发展有限公司 A kind of Word library updating method and device
CN107797817B (en) * 2017-03-13 2021-02-19 平安科技(深圳)有限公司 Application updating method and device
CN107894895A (en) * 2017-11-06 2018-04-10 网易(杭州)网络有限公司 Processing method, device, storage medium, processor and the server of code update
CN108664267A (en) * 2018-04-09 2018-10-16 上海瀚银信息技术有限公司 A kind of code automatic packaging system
CN109189464A (en) * 2018-07-11 2019-01-11 高新兴科技集团股份有限公司 A kind of method and apparatus of version management
CN109542248A (en) * 2018-11-16 2019-03-29 上海二三四五网络科技有限公司 A kind of control method and control device of incremental update dictionary data
CN109240727A (en) * 2018-11-20 2019-01-18 世纪龙信息网络有限责任公司 Application program update method, apparatus, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514417A (en) * 2012-06-25 2014-01-15 中兴通讯股份有限公司 Method, device and system for updating version information of electronic label
CN104182252A (en) * 2014-08-13 2014-12-03 墨仕(厦门)电子商务有限公司 App version incremental updating method
CN106326100A (en) * 2015-06-30 2017-01-11 中兴通讯股份有限公司 Software automatic testing method and device
CN107729041A (en) * 2017-07-26 2018-02-23 上海壹账通金融科技有限公司 The hot update method of application program, device, terminal and storage medium
CN110058873A (en) * 2019-03-12 2019-07-26 天津五八到家科技有限公司 Application page update method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN110727895A (en) 2020-01-24

Similar Documents

Publication Publication Date Title
CN111062013B (en) Account filtering method and device, electronic equipment and machine-readable storage medium
CN108390788B (en) User identification method and device and electronic equipment
CN109885786B (en) Data caching processing method and device, electronic equipment and readable storage medium
CN110113393B (en) Message pushing method and device, electronic equipment and medium
CN108647240B (en) Method and device for counting access amount, electronic equipment and storage medium
CN109213604B (en) Data source management method and device
CN110727895B (en) Sensitive word sending method and device, electronic equipment and storage medium
CN109450969B (en) Method and device for acquiring data from third-party data source server and server
CN110430070B (en) Service state analysis method, device, server, data analysis equipment and medium
CN111125240B (en) Distributed transaction realization method and device, electronic equipment and storage medium
CN111355765B (en) Network request processing and sending method and device
CN111563199A (en) Data processing method and device
CN112437148B (en) Service request processing method and device, service server and system
CN111367691B (en) Data feedback method and device, electronic equipment and storable medium
CN110427538B (en) Data query method, data storage method, data query device, data storage device and electronic equipment
CN110020166B (en) Data analysis method and related equipment
CN110955460A (en) Service process starting method and device, electronic equipment and storage medium
CN113163027B (en) Data identifier generation method, device, equipment and storage medium
CN109254855B (en) Registration method and device of parameter transmission protocol and electronic equipment
CN112115175B (en) Cloud service product processing method and device, electronic equipment and storage medium
CN111782418B (en) Data attribution method, device, electronic equipment and computer readable medium
CN112749190B (en) Data query method and device, computing equipment and computer storage medium
CN110674386B (en) Resource recommendation method, device and storage medium
CN113572824B (en) Dynamic updating method and device for timeout duration, electronic equipment and storage medium
CN113849133B (en) Processing method and device of privacy data, electronic equipment and storage medium

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