This application provides a method for adding a
watermark to data. Specifically, a plurality of pieces of to-be-processed data are obtained, and a plurality of groups corresponding to the plurality of pieces of to-be-processed data are further obtained. The plurality of groups include a target group. Then, watermarks are added to to-be-processed data in the target group by using the target group as a
granularity. Because watermarks are added to the plurality of pieces of to-be-processed data by using the group as the
granularity, although the to-be-processed data in the group is modified due to
watermark adding, the to-be-processed data changes within a range of a small amount of to-be-processed data included in the target group, and does not change within a range of all the to-be-processed data, thereby alleviating a problem that the data is severely distorted after
watermark adding. When to-be-processed data with similar
semantics is placed in a same group,
semantics of the to-be-processed data in the target group has a relatively small change after watermark adding. In addition, this application further provides an apparatus for adding a watermark to data and a related device.